Diff bash-4.2_p53 with a bash-4.3_p48-r2

/usr/portage/app-shells/bash/bash-4.3_p48-r2.ebuild 2026-07-11 20:03:05.940342706 +0300
7 7

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

  
12 12
# Official patchlevel
13
# See https://ftp.gnu.org/gnu/bash/bash-4.2-patches/
13
# See https://ftp.gnu.org/gnu/bash/bash-4.3-patches/
14 14
PLEVEL="${PV##*_p}"
15 15
MY_PV="${PV/_p*}"
16 16
MY_PV="${MY_PV/_/-}"
......
28 28
	fi
29 29
}
30 30

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

  
31 34
DESCRIPTION="The standard GNU Bourne again shell"
32 35
HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html"
33 36
SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
......
41 44
LICENSE="GPL-3"
42 45
SLOT="${MY_PV}"
43 46
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~m68k ~mips ppc ppc64 ~s390 ~sparc x86"
44
IUSE="afs mem-scramble +net nls +readline static"
47
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
45 48

  
46
LIB_DEPEND=">=sys-libs/ncurses-5.2-r2[static-libs(+)]
47
	nls? ( virtual/libintl )
48
	readline? ( >=sys-libs/readline-6.2[static-libs(+)] )"
49
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
50
DEPEND="${RDEPEND}
51
	static? ( ${LIB_DEPEND} )"
49
DEPEND=">=sys-libs/ncurses-5.2-r2:0=
50
	readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
51
	nls? ( virtual/libintl )"
52
RDEPEND="${DEPEND}
53
	!<sys-apps/portage-2.1.6.7_p1"
52 54
# We only need bison (yacc) when the .y files get patched (bash42-005)
53 55
BDEPEND="sys-devel/bison"
54 56

  
55 57
PATCHES=(
56
	"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-execute-job-control.patch # bug #383237
57
	"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-parallel-build.patch
58
	"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-no-readline.patch
59
	"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-read-retry.patch # bug #447810
60
	"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-speed-up-read-N.patch
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
61 62
)
62 63

  
63 64
pkg_setup() {
......
67 68
		eerror "as it breaks LFS (struct stat64) on x86."
68 69
		die "remove -malign-double from your CFLAGS mr ricer"
69 70
	fi
71

  
72
	if use bashlogger ; then
73
		ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
74
		ewarn "This will log ALL output you enter into the shell, you have been warned."
75
	fi
70 76
}
71 77

  
72 78
src_unpack() {
......
81 87
	# Include official patches
82 88
	[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
83 89

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

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

  
......
111 119
	fi
112 120

  
113 121
	local myconf=(
114
		--with-installed-readline=.
122
		--docdir='$(datarootdir)'/doc/${PF}
123
		--htmldir='$(docdir)/html'
115 124

  
116 125
		# Force linking with system curses ... the bundled termcap lib
117 126
		# sucks bad compared to ncurses.  For the most part, ncurses
......
132 141
	# For descriptions of these, see config-top.h
133 142
	# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
134 143
	append-cppflags \
135
		-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
136
		-DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
137
		-DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
138
		-DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
144
		-DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
145
		-DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
146
		-DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
147
		-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
139 148
		-DNON_INTERACTIVE_LOGIN_SHELLS \
140 149
		-DSSH_SOURCE_BASHRC \
141
		-DUSE_MKTEMP -DUSE_MKSTEMP
150
		-DUSE_MKTEMP -DUSE_MKSTEMP \
151
		$(use bashlogger && echo -DSYSLOG_HISTORY)
142 152

  
143
	use static && append-ldflags -static
153
	# Don't even think about building this statically without
154
	# reading bug #7714 first.  If you still build it statically,
155
	# don't come crying to us with bugs ;).
156
	#use static && export LDFLAGS="${LDFLAGS} -static"
144 157
	use nls || myconf+=( --disable-nls )
145 158

  
146 159
	# Historically, we always used the builtin readline, but since
......
150 163
	# be safe.
151 164
	# Exact cached version here doesn't really matter as long as it
152 165
	# is at least what's in the DEPEND up above.
153
	export ac_cv_rl_version=6.2
166
	export ac_cv_rl_version=${READLINE_VER}
167

  
168
	if [[ ${PV} != *_rc* ]] ; then
169
		# Use system readline only with released versions.
170
		myconf+=( --with-installed-readline=. )
171
	fi
172

  
173
	if use plugins ; then
174
		append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
175
	else
176
		# Disable the plugins logic by hand since bash doesn't
177
		# provide a way of doing it.
178
		export ac_cv_func_dl{close,open,sym}=no \
179
			ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
180

  
181
		sed -i \
182
			-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
183
			configure || die
184
	fi
154 185

  
155 186
	# bug #444070
156 187
	tc-export AR
......
158 189
	econf "${myconf[@]}"
159 190
}
160 191

  
192
src_compile() {
193
	emake
194

  
195
	if use plugins ; then
196
		emake -C examples/loadables all others
197
	fi
198
}
199

  
161 200
src_install() {
162 201
	into /
163 202
	newbin bash bash-${SLOT}
Thank you!