Skip to content

Commit

Permalink
app-shells/bash: EAPI-7 conversion
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/742575
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Lars Wendler <[email protected]>
  • Loading branch information
Lars Wendler committed Sep 24, 2020
1 parent 1447929 commit e5a76c9
Show file tree
Hide file tree
Showing 24 changed files with 337 additions and 327 deletions.
71 changes: 36 additions & 35 deletions app-shells/bash/bash-2.05b_p13.ebuild
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="4"
EAPI=7

inherit eutils flag-o-matic toolchain-funcs
inherit flag-o-matic toolchain-funcs

# Official patchlevel
# See ftp://ftp.cwru.edu/pub/bash/bash-2.05b-patches/
PLEVEL=${PV##*_p}
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
MY_P=${PN}-${MY_PV}
PLEVEL="${PV##*_p}"
MY_PV="${PV/_p*}"
MY_PV="${MY_PV/_/-}"
MY_P="${PN}-${MY_PV}"
[[ ${PV} != *_p* ]] && PLEVEL=0
patches() {
local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
[[ ${plevel} -eq 0 ]] && return 1
eval set -- {1..${plevel}}
set -- $(printf "${pn}${pv/\.}-%03d " "$@")
Expand Down Expand Up @@ -43,7 +43,19 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
DEPEND="${RDEPEND}
static? ( ${LIB_DEPEND} )"

S=${WORKDIR}/${MY_P}
S="${WORKDIR}/${MY_P}"

PATCHES=(
"${FILESDIR}"/${PN}-2.05b-destdir.patch
"${FILESDIR}"/autoconf-mktime-2.53.patch #220040
"${FILESDIR}"/${PN}-2.05b-protos.patch
"${FILESDIR}"/${PN}-2.05b-empty-herestring.patch
"${FILESDIR}"/${PN}-2.05b-rbash.patch #26854
"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
"${FILESDIR}"/${PN}-2.05b-jobs.patch
"${FILESDIR}"/${PN}-2.05b-fix-job-warning.patch
"${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
)

pkg_setup() {
if is-flag -malign-double ; then #7332
Expand All @@ -59,28 +71,28 @@ src_unpack() {

src_prepare() {
# Include official patches
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)

# Clean out local libs so we know we use system ones
rm -rf lib/{readline,termcap}/*
touch lib/{readline,termcap}/Makefile.in # for config.status
rm -rf lib/{readline,termcap}/* || die
touch lib/{readline,termcap}/Makefile.in || die # for config.status
sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die

epatch "${FILESDIR}"/${PN}-2.05b-destdir.patch
epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040
epatch "${FILESDIR}"/${PN}-2.05b-protos.patch
epatch "${FILESDIR}"/${PN}-2.05b-empty-herestring.patch
epatch "${FILESDIR}"/${PN}-2.05b-rbash.patch #26854
epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
epatch "${FILESDIR}"/${PN}-2.05b-jobs.patch
epatch "${FILESDIR}"/${PN}-2.05b-fix-job-warning.patch
epatch "${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850

epatch_user
default
}

src_configure() {
local myconf=()
local myconf=(
--with-installed-readline=.
--with-curses
$(use_with afs)
$(use_enable net net-redirections)
--disable-profiling
--without-gnu-malloc
$(use_enable readline)
$(use_enable readline history)
$(use_enable readline bang-history)
)

# Force pgrp synchronization
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
Expand Down Expand Up @@ -118,18 +130,7 @@ src_configure() {
# This old autoconf script does not re-exec itself properly and fails when
# /bin/sh is not bash. Rather than try to regen everything, just force the
# use of bash directly.
CONFIG_SHELL="/bin/bash" \
econf \
--with-installed-readline=. \
--with-curses \
$(use_with afs) \
$(use_enable net net-redirections) \
--disable-profiling \
--without-gnu-malloc \
$(use_enable readline) \
$(use_enable readline history) \
$(use_enable readline bang-history) \
"${myconf[@]}"
CONFIG_SHELL="/bin/bash" econf "${myconf[@]}"
}

src_install() {
Expand Down
81 changes: 39 additions & 42 deletions app-shells/bash/bash-3.0_p22.ebuild
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="4"
EAPI=7

inherit eutils flag-o-matic toolchain-funcs
inherit flag-o-matic toolchain-funcs

# Official patchlevel
# See ftp://ftp.cwru.edu/pub/bash/bash-3.0-patches/
PLEVEL=${PV##*_p}
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
MY_P=${PN}-${MY_PV}
PLEVEL="${PV##*_p}"
MY_PV="${PV/_p*}"
MY_PV="${MY_PV/_/-}"
MY_P="${PN}-${MY_PV}"
[[ ${PV} != *_p* ]] && PLEVEL=0
patches() {
local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
[[ ${plevel} -eq 0 ]] && return 1
eval set -- {1..${plevel}}
set -- $(printf "${pn}${pv/\.}-%03d " "$@")
Expand Down Expand Up @@ -43,7 +43,22 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
DEPEND="${RDEPEND}
static? ( ${LIB_DEPEND} )"

S=${WORKDIR}/${MY_P}
S="${WORKDIR}/${MY_P}"

PATCHES=(
"${FILESDIR}"/autoconf-mktime-2.53.patch #220040
"${FILESDIR}"/${PN}-3.0-protos.patch
"${FILESDIR}"/${PN}-3.0-rbash.patch #26854
"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
"${FILESDIR}"/${PN}-3.0-darwin-conn.patch #79124
# read patch headers for more info ... many ripped from Fedora/Debian[17]/SuSe/upstream
"${FILESDIR}"/${PN}-3.0-{afs,crash,jobs,manpage,pwd,ulimit,histtimeformat,locale,multibyteifs,subshell,volatile-command}.patch
"${FILESDIR}"/${PN}-3.0-read-builtin-pipe.patch #87093
"${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
"${FILESDIR}"/${PN}-3.0-pgrp-pipe-fix.patch #92349
"${FILESDIR}"/${PN}-3.0-strnlen.patch
"${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
)

pkg_setup() {
if is-flag -malign-double ; then #7332
Expand All @@ -59,36 +74,28 @@ src_unpack() {

src_prepare() {
# Include official patches
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)

# Clean out local libs so we know we use system ones
rm -rf lib/{readline,termcap}/*
touch lib/{readline,termcap}/Makefile.in # for config.status
rm -rf lib/{readline,termcap}/* || die
touch lib/{readline,termcap}/Makefile.in || die # for config.status
sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die

epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040
epatch "${FILESDIR}"/${PN}-3.0-protos.patch
epatch "${FILESDIR}"/${PN}-3.0-rbash.patch #26854
epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
epatch "${FILESDIR}"/${PN}-3.0-darwin-conn.patch #79124
# read patch headers for more info ... many ripped from Fedora/Debian[17]/SuSe/upstream
for i in afs crash jobs manpage pwd ulimit histtimeformat \
locale multibyteifs subshell \
volatile-command
do
epatch "${FILESDIR}"/${PN}-3.0-${i}.patch
done
epatch "${FILESDIR}"/${PN}-3.0-read-builtin-pipe.patch #87093
epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
epatch "${FILESDIR}"/${PN}-3.0-pgrp-pipe-fix.patch #92349
epatch "${FILESDIR}"/${PN}-3.0-strnlen.patch
epatch "${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850

epatch_user
default
}

src_configure() {
local myconf=()
local myconf=(
--with-installed-readline=.
--with-curses
$(use_with afs)
$(use_enable net net-redirections)
--disable-profiling
--without-gnu-malloc
$(use_enable readline)
$(use_enable readline history)
$(use_enable readline bang-history)
)

# Force pgrp synchronization
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
Expand Down Expand Up @@ -123,17 +130,7 @@ src_configure() {
# ncurses in one or two small places :(.

tc-export AR #444070
econf \
--with-installed-readline=. \
--with-curses \
$(use_with afs) \
$(use_enable net net-redirections) \
--disable-profiling \
--without-gnu-malloc \
$(use_enable readline) \
$(use_enable readline history) \
$(use_enable readline bang-history) \
"${myconf[@]}"
econf "${myconf[@]}"
}

src_install() {
Expand Down
70 changes: 36 additions & 34 deletions app-shells/bash/bash-3.1_p23.ebuild
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="4"
EAPI=7

inherit eutils flag-o-matic toolchain-funcs
inherit flag-o-matic toolchain-funcs

# Official patchlevel
# See ftp://ftp.cwru.edu/pub/bash/bash-3.1-patches/
PLEVEL=${PV##*_p}
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
MY_P=${PN}-${MY_PV}
PLEVEL="${PV##*_p}"
MY_PV="${PV/_p*}"
MY_PV="${MY_PV/_/-}"
MY_P="${PN}-${MY_PV}"
[[ ${PV} != *_p* ]] && PLEVEL=0
patches() {
local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
[[ ${plevel} -eq 0 ]] && return 1
eval set -- {1..${plevel}}
set -- $(printf "${pn}${pv/\.}-%03d " "$@")
Expand Down Expand Up @@ -43,7 +43,19 @@ RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
DEPEND="${RDEPEND}
static? ( ${LIB_DEPEND} )"

S=${WORKDIR}/${MY_P}
S="${WORKDIR}/${MY_P}"

PATCHES=(
"${FILESDIR}"/autoconf-mktime-2.53.patch #220040
"${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
"${FILESDIR}"/${PN}-3.1-protos.patch
"${FILESDIR}"/${PN}-3.1-ulimit.patch
"${FILESDIR}"/${PN}-3.0-read-memleak.patch
"${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
"${FILESDIR}"/${PN}-3.1-fix-dash-login-shell.patch #118257
"${FILESDIR}"/${PN}-3.1-dev-fd-test-as-user.patch #131875
"${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850
)

pkg_setup() {
if is-flag -malign-double ; then #7332
Expand All @@ -59,28 +71,28 @@ src_unpack() {

src_prepare() {
# Include official patches
[[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)

# Clean out local libs so we know we use system ones
rm -rf lib/{readline,termcap}/*
touch lib/{readline,termcap}/Makefile.in # for config.status
rm -rf lib/{readline,termcap}/* || die
touch lib/{readline,termcap}/Makefile.in || die # for config.status
sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die

epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040
epatch "${FILESDIR}"/${PN}-2.05b-parallel-build.patch #41002
epatch "${FILESDIR}"/${PN}-3.1-protos.patch
epatch "${FILESDIR}"/${PN}-3.1-ulimit.patch
epatch "${FILESDIR}"/${PN}-3.0-read-memleak.patch
epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
epatch "${FILESDIR}"/${PN}-3.1-fix-dash-login-shell.patch #118257
epatch "${FILESDIR}"/${PN}-3.1-dev-fd-test-as-user.patch #131875
epatch "${FILESDIR}"/${PN}-3.1-dev-fd-buffer-overflow.patch #431850

epatch_user
default
}

src_configure() {
local myconf=()
local myconf=(
--with-installed-readline=.
--with-curses
$(use_with afs)
$(use_enable net net-redirections)
--disable-profiling
--without-gnu-malloc
$(use_enable readline)
$(use_enable readline history)
$(use_enable readline bang-history)
)

# Force pgrp synchronization
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
Expand Down Expand Up @@ -115,17 +127,7 @@ src_configure() {
# ncurses in one or two small places :(.

tc-export AR #444070
econf \
--with-installed-readline=. \
--with-curses \
$(use_with afs) \
$(use_enable net net-redirections) \
--disable-profiling \
--without-gnu-malloc \
$(use_enable readline) \
$(use_enable readline history) \
$(use_enable readline bang-history) \
"${myconf[@]}"
econf "${myconf[@]}"
}

src_install() {
Expand Down
Loading

0 comments on commit e5a76c9

Please sign in to comment.