1 |
1 |
# Copyright 1999-2025 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 |
6 |
# There's no standard way of versioning the point releases upstream
|
7 |
7 |
# make anyway, so while this was added for RC versions, it's fine
|
... | ... | |
18 |
18 |
MY_P="${PN}-${MY_PV}"
|
19 |
19 |
MY_PATCHES=()
|
20 |
20 |
|
21 |
|
is_release() {
|
22 |
|
case ${PV} in
|
23 |
|
9999|*_alpha*|*_beta*|*_rc*)
|
24 |
|
return 1
|
25 |
|
;;
|
26 |
|
*)
|
27 |
|
return 0
|
28 |
|
;;
|
29 |
|
esac
|
30 |
|
}
|
31 |
|
|
32 |
|
[[ ${PV} != *_p* ]] && PLEVEL=0
|
|
21 |
# Determine the patchlevel.
|
|
22 |
case ${PV} in
|
|
23 |
9999|*_alpha*|*_beta*|*_rc*)
|
|
24 |
# Set a negative patchlevel to indicate that it's a pre-release.
|
|
25 |
PLEVEL=-1
|
|
26 |
;;
|
|
27 |
*_p*)
|
|
28 |
PLEVEL=${PV##*_p}
|
|
29 |
;;
|
|
30 |
*)
|
|
31 |
PLEVEL=0
|
|
32 |
esac
|
33 |
33 |
|
34 |
34 |
DESCRIPTION="Another cute console display library"
|
35 |
35 |
HOMEPAGE="https://tiswww.case.edu/php/chet/readline/rltop.html https://git.savannah.gnu.org/cgit/readline.git"
|
... | ... | |
38 |
38 |
EGIT_REPO_URI="https://git.savannah.gnu.org/git/readline.git"
|
39 |
39 |
EGIT_BRANCH=devel
|
40 |
40 |
inherit git-r3
|
41 |
|
elif is_release ; then
|
|
41 |
elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
|
|
42 |
# It can be useful to have snapshots in the pre-release period once
|
|
43 |
# the first alpha is out, as various bugs get reported and fixed from
|
|
44 |
# the alpha, and the next pre-release is usually quite far away.
|
|
45 |
#
|
|
46 |
# i.e. if it's worth packaging the alpha, it's worth packaging a followup.
|
|
47 |
READLINE_COMMIT="7cf2d923617659d216db3210f6247740f7dde1d8"
|
|
48 |
SRC_URI="https://git.savannah.gnu.org/cgit/readline.git/snapshot/readline-${READLINE_COMMIT}.tar.gz -> ${P}-${READLINE_COMMIT}.tar.gz"
|
|
49 |
S=${WORKDIR}/${PN}-${READLINE_COMMIT}
|
|
50 |
else
|
42 |
51 |
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz"
|
43 |
|
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/readline-8.1-rlfe-c99.patch.xz"
|
44 |
52 |
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig )"
|
|
53 |
S="${WORKDIR}/${MY_P}"
|
45 |
54 |
|
46 |
55 |
if [[ ${PLEVEL} -gt 0 ]] ; then
|
47 |
56 |
# bash-5.1 -> bash51
|
... | ... | |
64 |
73 |
|
65 |
74 |
unset my_p patch_url my_patch_index upstream_url_base
|
66 |
75 |
fi
|
67 |
|
else
|
68 |
|
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz"
|
69 |
|
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig )"
|
70 |
|
fi
|
71 |
|
|
72 |
|
S="${WORKDIR}/${MY_P}"
|
73 |
|
|
74 |
|
if ! is_release ; then
|
75 |
|
inherit autotools
|
76 |
76 |
fi
|
77 |
77 |
|
78 |
78 |
LICENSE="GPL-3+"
|
79 |
79 |
SLOT="0/8" # subslot matches SONAME major
|
80 |
|
if is_release ; then
|
81 |
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
|
|
80 |
if (( PLEVEL >= 0 )); then
|
|
81 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
|
82 |
82 |
fi
|
83 |
83 |
IUSE="static-libs +unicode utils"
|
84 |
84 |
|
85 |
85 |
RDEPEND=">=sys-libs/ncurses-5.9-r3:=[static-libs?,unicode(+)?,${MULTILIB_USEDEP}]"
|
86 |
86 |
DEPEND="${RDEPEND}"
|
87 |
|
BDEPEND="virtual/pkgconfig
|
88 |
|
verify-sig? ( sec-keys/openpgp-keys-chetramey )"
|
|
87 |
BDEPEND="
|
|
88 |
virtual/pkgconfig
|
|
89 |
verify-sig? ( sec-keys/openpgp-keys-chetramey )
|
|
90 |
"
|
89 |
91 |
|
90 |
92 |
PATCHES=(
|
91 |
93 |
"${FILESDIR}"/${PN}-5.0-no_rpath.patch
|
92 |
94 |
"${FILESDIR}"/${PN}-7.0-headers.patch
|
93 |
95 |
"${FILESDIR}"/${PN}-8.0-headers.patch
|
94 |
|
"${WORKDIR}"/${PN}-8.1-rlfe-c99.patch
|
95 |
|
# Not needed with 8.3 which drops < C89 compat
|
96 |
|
"${FILESDIR}"/${PN}-8.2-c23.patch
|
97 |
96 |
)
|
98 |
97 |
|
99 |
98 |
src_unpack() {
|
... | ... | |
101 |
100 |
|
102 |
101 |
if [[ ${PV} == 9999 ]]; then
|
103 |
102 |
git-r3_src_unpack
|
|
103 |
elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
|
|
104 |
default
|
104 |
105 |
else
|
105 |
106 |
if use verify-sig; then
|
106 |
107 |
verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
|
... | ... | |
111 |
112 |
fi
|
112 |
113 |
|
113 |
114 |
unpack "${MY_P}.tar.gz"
|
114 |
|
unpack readline-8.1-rlfe-c99.patch.xz
|
115 |
115 |
|
116 |
|
#if [[ ${GENTOO_PATCH_VER} ]]; then
|
117 |
|
# unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
|
118 |
|
#fi
|
|
116 |
if [[ ${GENTOO_PATCH_VER} ]]; then
|
|
117 |
unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
|
|
118 |
fi
|
119 |
119 |
fi
|
120 |
120 |
}
|
121 |
121 |
|
122 |
122 |
src_prepare() {
|
123 |
|
[[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
|
|
123 |
(( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
|
124 |
124 |
|
125 |
125 |
default
|
126 |
126 |
|
127 |
|
is_release || eautoreconf
|
|
127 |
#(( PLEVEL < 0 )) && eautoreconf
|
128 |
128 |
|
129 |
129 |
if use prefix && [[ ! -x "${BROOT}"/usr/bin/pkg-config ]] ; then
|
130 |
130 |
# If we're bootstrapping, make a guess. We don't have pkg-config
|
... | ... | |
148 |
148 |
-e "/^SHLIB_LIBS=/s:=.*:='${ncurses_libs}':" \
|
149 |
149 |
support/shobj-conf || die
|
150 |
150 |
sed -i \
|
151 |
|
-e "/^[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \
|
|
151 |
-e "/[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \
|
152 |
152 |
examples/rlfe/configure || die
|
153 |
153 |
|
154 |
154 |
# Fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
|
... | ... | |
160 |
160 |
}
|
161 |
161 |
|
162 |
162 |
src_configure() {
|
163 |
|
# readline-8.3 drops unprototyped functions, earlier versions are
|
164 |
|
# incompatible with C23.
|
165 |
|
append-cflags $(test-flags-CC -std=gnu17)
|
166 |
|
|
167 |
163 |
# Fix implicit decls with widechar funcs
|
168 |
164 |
append-cppflags -D_GNU_SOURCE
|
169 |
165 |
# https://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html
|