1 |
|
# Copyright 1999-2022 Gentoo Authors
|
|
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit autotools
|
|
6 |
inherit autotools edo flag-o-matic
|
7 |
7 |
|
8 |
8 |
MY_P="${PN}${PV}"
|
9 |
9 |
DESCRIPTION="tool for automating interactive applications"
|
10 |
10 |
HOMEPAGE="https://core.tcl-lang.org/expect/"
|
11 |
11 |
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
|
|
12 |
S="${WORKDIR}"/${MY_P}
|
12 |
13 |
|
13 |
14 |
LICENSE="BSD"
|
14 |
15 |
SLOT="0"
|
15 |
16 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
|
16 |
|
IUSE="debug doc threads"
|
|
17 |
IUSE="debug doc test threads"
|
|
18 |
RESTRICT="!test? ( test )"
|
17 |
19 |
|
18 |
|
# We need dejagnu for src_test, but dejagnu needs expect
|
19 |
|
# to compile/run, so we cant add dejagnu to DEPEND :/
|
20 |
20 |
DEPEND=">=dev-lang/tcl-8.2:=[threads?]"
|
21 |
21 |
RDEPEND="${DEPEND}"
|
22 |
|
|
23 |
|
S=${WORKDIR}/${MY_P}
|
|
22 |
BDEPEND="test? ( dev-util/dejagnu )"
|
24 |
23 |
|
25 |
24 |
PATCHES=( "${FILESDIR}"/${P}-examples.patch )
|
26 |
25 |
|
... | ... | |
33 |
32 |
eapply "${FILESDIR}"/${PN}-5.45-headers.patch #337943
|
34 |
33 |
eapply "${FILESDIR}"/${PN}-5.45-format-security.patch
|
35 |
34 |
eapply "${FILESDIR}"/${PN}-5.45.4-configure-in.patch
|
36 |
|
sed -i 's:ifdef HAVE_SYS_WAIT_H:ifndef NO_SYS_WAIT_H:' *.c
|
|
35 |
eapply "${FILESDIR}"/${PN}-5.45.4-configure-clang16.patch || die
|
|
36 |
|
|
37 |
sed -i 's:ifdef HAVE_SYS_WAIT_H:ifndef NO_SYS_WAIT_H:' *.c || die
|
37 |
38 |
|
38 |
39 |
# fix install_name on darwin
|
39 |
40 |
[[ ${CHOST} == *-darwin* ]] && \
|
... | ... | |
45 |
46 |
}
|
46 |
47 |
|
47 |
48 |
src_configure() {
|
|
49 |
# bug #881687
|
|
50 |
append-flags -std=gnu89
|
|
51 |
|
48 |
52 |
# the 64bit flag is useless ... it only adds 64bit compiler flags
|
49 |
53 |
# (like -m64) which the target toolchain should already handle
|
50 |
54 |
econf \
|
... | ... | |
55 |
59 |
$(use_enable debug symbols mem)
|
56 |
60 |
}
|
57 |
61 |
|
58 |
|
src_test() {
|
59 |
|
# we need dejagnu to do tests ... but dejagnu needs
|
60 |
|
# expect ... so don't do tests unless we have dejagnu
|
61 |
|
type -p runtest || return 0
|
62 |
|
emake test
|
63 |
|
}
|
64 |
|
|
65 |
62 |
expect_make_var() {
|
66 |
|
touch pkgIndex.tcl-hand
|
|
63 |
touch pkgIndex.tcl-hand || die
|
67 |
64 |
printf 'all:;echo $('$1')\ninclude Makefile' | emake --no-print-directory -s -f -
|
68 |
65 |
rm -f pkgIndex.tcl-hand || die
|
69 |
66 |
}
|
... | ... | |
73 |
70 |
|
74 |
71 |
if use doc ; then
|
75 |
72 |
docinto examples
|
76 |
|
echo dodoc \
|
77 |
|
example/README \
|
78 |
|
$(printf 'example/%s ' $(expect_make_var _SCRIPTS)) \
|
79 |
|
$(printf 'example/%s.man ' $(expect_make_var _SCRIPTS_MANPAGES))
|
80 |
|
dodoc \
|
|
73 |
|
|
74 |
edo dodoc \
|
81 |
75 |
example/README \
|
82 |
76 |
$(printf 'example/%s ' $(expect_make_var _SCRIPTS)) \
|
83 |
77 |
$(printf 'example/%s.man ' $(expect_make_var _SCRIPTS_MANPAGES))
|