Diff bash-4.3_p48-r2 with a bash-4.4_p23-r2

/usr/portage/app-shells/bash/bash-4.4_p23-r2.ebuild 2025-07-29 16:22:12.596448153 +0300
3 3

  
4 4
EAPI=7
5 5

  
6
inherit flag-o-matic toolchain-funcs
6
inherit flag-o-matic toolchain-funcs prefix
7 7

  
8 8
# Uncomment if we have a patchset
9 9
GENTOO_PATCH_DEV="sam"
10 10
GENTOO_PATCH_VER="${PV}-r2"
11 11

  
12 12
# Official patchlevel
13
# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
13
# See ftp://ftp.cwru.edu/pub/bash/bash-4.4-patches/
14 14
PLEVEL="${PV##*_p}"
15 15
MY_PV="${PV/_p*}"
16 16
MY_PV="${MY_PV/_/-}"
17 17
MY_P="${PN}-${MY_PV}"
18
is_release() {
19
	case ${PV} in
20
	*_alpha*|*_beta*|*_rc*) return 1 ;;
21
	*) return 0 ;;
22
	esac
23
}
18 24
[[ ${PV} != *_p* ]] && PLEVEL=0
19 25
patches() {
20 26
	local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
......
29 35
}
30 36

  
31 37
# The version of readline this bash normally ships with.
32
READLINE_VER="6.3"
38
READLINE_VER="7.0"
33 39

  
34 40
DESCRIPTION="The standard GNU Bourne again shell"
35 41
HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html"
36
SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
42
if is_release ; then
43
	SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
44
fi
37 45

  
38 46
if [[ -n ${GENTOO_PATCH_VER} ]] ; then
39 47
	SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
......
43 51

  
44 52
LICENSE="GPL-3"
45 53
SLOT="${MY_PV}"
46
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 ~s390 sparc x86"
54
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
47 55
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
48 56

  
49
DEPEND=">=sys-libs/ncurses-5.2-r2:0=
57
DEPEND="
58
	>=sys-libs/ncurses-5.2-r2:0=
59
	nls? ( virtual/libintl )
50 60
	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
51
	nls? ( virtual/libintl )"
52
RDEPEND="${DEPEND}
53
	!<sys-apps/portage-2.1.6.7_p1"
61
"
62
RDEPEND="
63
	${DEPEND}
64
"
54 65
# We only need bison (yacc) when the .y files get patched (bash42-005)
55
BDEPEND="sys-devel/bison"
56

  
57
PATCHES=(
58
	"${WORKDIR}"/${P}-r2-patches/${PN}-4.3-mapfile-improper-array-name-validation.patch
59
	"${WORKDIR}"/${P}-r2-patches/${PN}-4.3-arrayfunc.patch
60
	"${WORKDIR}"/${P}-r2-patches/${PN}-4.3-protos.patch
61
	"${WORKDIR}"/${P}-r2-patches/${PN}-4.4-popd-offset-overflow.patch # bug #600174
62
)
66
#BDEPEND="sys-devel/bison"
63 67

  
64 68
pkg_setup() {
65 69
	# bug #7332
......
87 91
	# Include official patches
88 92
	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
89 93

  
94
	eapply "${WORKDIR}"/${P}-r2-patches/${PN}-4.4-jobs_overflow.patch # bug #644720
95
	eapply "${WORKDIR}"/${P}-r2-patches/${PN}-4.4-set-SHOBJ_STATUS.patch # bug #644720
96

  
90 97
	# Clean out local libs so we know we use system ones w/releases.
91
	if [[ ${PV} != *_rc* ]] ; then
98
	if is_release ; then
92 99
		rm -rf lib/{readline,termcap}/* || die
93 100
		touch lib/{readline,termcap}/Makefile.in || die # for config.status
94 101
		sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
95 102
	fi
96 103

  
104
	# Prefixify hardcoded path names. No-op for non-prefix.
105
	hprefixify pathnames.h.in
106

  
97 107
	# Avoid regenerating docs after patches, bug #407985
98 108
	sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
99 109
	touch -r . doc/* || die
100 110

  
101
	default
111
	eapply_user
102 112
}
103 113

  
104 114
src_configure() {
......
118 128
	fi
119 129

  
120 130
	local myconf=(
121
		--docdir='$(datarootdir)'/doc/${PF}
122
		--htmldir='$(docdir)/html'
131
		--disable-profiling
123 132

  
124 133
		# Force linking with system curses ... the bundled termcap lib
125 134
		# sucks bad compared to ncurses.  For the most part, ncurses
......
127 136
		# ncurses in one or two small places :(.
128 137
		--with-curses
129 138

  
130
		$(use_with afs)
131
		$(use_enable net net-redirections)
132
		--disable-profiling
133 139
		$(use_enable mem-scramble)
134
		$(use_with mem-scramble bash-malloc)
140
		$(use_enable net net-redirections)
135 141
		$(use_enable readline)
136
		$(use_enable readline history)
137 142
		$(use_enable readline bang-history)
143
		$(use_enable readline history)
144
		$(use_with afs)
145
		$(use_with mem-scramble bash-malloc)
138 146
	)
139 147

  
140 148
	# For descriptions of these, see config-top.h
......
146 154
		-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
147 155
		-DNON_INTERACTIVE_LOGIN_SHELLS \
148 156
		-DSSH_SOURCE_BASHRC \
149
		-DUSE_MKTEMP -DUSE_MKSTEMP \
150 157
		$(use bashlogger && echo -DSYSLOG_HISTORY)
151 158

  
152 159
	# Don't even think about building this statically without
......
162 169
	# be safe.
163 170
	# Exact cached version here doesn't really matter as long as it
164 171
	# is at least what's in the DEPEND up above.
165
	export ac_cv_rl_version=${READLINE_VER}
172
	export ac_cv_rl_version=${READLINE_VER%%_*}
166 173

  
167
	if [[ ${PV} != *_rc* ]] ; then
174
	if is_release ; then
168 175
		# Use system readline only with released versions.
169 176
		myconf+=( --with-installed-readline=. )
170 177
	fi
Thank you!