| 1 |
|
# Copyright 1999-2025 Gentoo Authors
|
|
1 |
# Copyright 1999-2026 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
6 |
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/m4.asc
|
| 7 |
|
inherit flag-o-matic verify-sig
|
|
7 |
inherit branding flag-o-matic verify-sig
|
| 8 |
8 |
|
| 9 |
9 |
DESCRIPTION="GNU macro processor"
|
| 10 |
10 |
HOMEPAGE="https://www.gnu.org/software/m4/m4.html"
|
| 11 |
|
if [[ ${PV} == *_beta* ]] ; then
|
| 12 |
|
MY_P="${PN}-1.4.18d"
|
| 13 |
|
SRC_URI="https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz"
|
| 14 |
|
SRC_URI+=" verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz.sig )"
|
| 15 |
|
S="${WORKDIR}/${MY_P}"
|
|
11 |
if [[ ${PV} == *_p* ]] ; then
|
|
12 |
# Note: could put this in devspace, but if it's gone, we don't want
|
|
13 |
# it in tree anyway. It's just for testing.
|
|
14 |
MY_SNAPSHOT="$(ver_cut 1-3).65-bdd9"
|
|
15 |
SRC_URI="
|
|
16 |
https://alpha.gnu.org/gnu/${PN}/${PN}-${MY_SNAPSHOT}.tar.xz
|
|
17 |
https://people.redhat.com/eblake/${PN}/${PN}-${MY_SNAPSHOT}.tar.xz
|
|
18 |
verify-sig? (
|
|
19 |
https://alpha.gnu.org/gnu/${PN}/${PN}-${MY_SNAPSHOT}.tar.xz.sig
|
|
20 |
https://people.redhat.com/eblake/${PN}/${PN}-${MY_SNAPSHOT}.tar.xz.sig
|
|
21 |
)
|
|
22 |
"
|
|
23 |
S="${WORKDIR}"/${PN}-${MY_SNAPSHOT}
|
| 16 |
24 |
else
|
| 17 |
25 |
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
|
| 18 |
|
SRC_URI+=" https://dev.gentoo.org/~floppym/dist/${P}-test-198-sysval-r1.patch.gz"
|
| 19 |
26 |
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )"
|
| 20 |
27 |
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
|
| 21 |
28 |
fi
|
| ... | ... | |
| 29 |
36 |
nls? (
|
| 30 |
37 |
sys-devel/gettext
|
| 31 |
38 |
virtual/libintl
|
| 32 |
|
)"
|
|
39 |
)
|
|
40 |
"
|
| 33 |
41 |
DEPEND="${RDEPEND}"
|
| 34 |
42 |
# Remember: cannot dep on autoconf since it needs us
|
| 35 |
|
BDEPEND="app-arch/xz-utils
|
|
43 |
BDEPEND="
|
|
44 |
app-arch/xz-utils
|
| 36 |
45 |
nls? ( sys-devel/gettext )
|
| 37 |
|
verify-sig? ( sec-keys/openpgp-keys-m4 )"
|
| 38 |
|
|
| 39 |
|
PATCHES=(
|
| 40 |
|
"${FILESDIR}"/ppc-musl.patch
|
| 41 |
|
"${FILESDIR}"/loong-fix-build.patch
|
| 42 |
|
"${FILESDIR}"/${PN}-1.4.19-make-4.4-tests.patch
|
| 43 |
|
"${WORKDIR}"/${P}-test-198-sysval-r1.patch
|
| 44 |
|
"${FILESDIR}"/${P}-fortify-source.patch
|
| 45 |
|
"${FILESDIR}"/${P}-race-condition-tests.patch
|
| 46 |
|
)
|
| 47 |
|
|
| 48 |
|
src_unpack() {
|
| 49 |
|
if use verify-sig ; then
|
| 50 |
|
# Needed for downloaded patch (which is unsigned, which is fine)
|
| 51 |
|
verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig}
|
| 52 |
|
fi
|
| 53 |
|
|
| 54 |
|
default
|
| 55 |
|
}
|
|
46 |
verify-sig? ( sec-keys/openpgp-keys-m4 )
|
|
47 |
"
|
| 56 |
48 |
|
| 57 |
49 |
src_prepare() {
|
| 58 |
50 |
default
|
| ... | ... | |
| 60 |
52 |
# touch generated files after patching m4, to avoid activating maintainer
|
| 61 |
53 |
# mode
|
| 62 |
54 |
# remove when loong-fix-build.patch is no longer necessary
|
| 63 |
|
touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die
|
| 64 |
|
find . -name Makefile.in -exec touch {} + || die
|
|
55 |
#touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die
|
|
56 |
#find . -name Makefile.in -exec touch {} + || die
|
| 65 |
57 |
}
|
| 66 |
58 |
|
| 67 |
59 |
src_configure() {
|
| 68 |
|
# https://savannah.gnu.org/support/index.php?111150
|
| 69 |
|
append-cflags $(test-flags-CC -std=gnu17)
|
|
60 |
# see https://bugs.gentoo.org/955947
|
|
61 |
append-flags -Wno-error=format-security
|
| 70 |
62 |
|
| 71 |
63 |
local -a myeconfargs=(
|
| 72 |
64 |
--enable-changeword
|
| 73 |
|
|
| 74 |
|
--with-packager="Gentoo Linux"
|
| 75 |
|
--with-packager-version="${PVR}"
|
| 76 |
|
--with-packager-bug-reports="https://bugs.gentoo.org/"
|
| 77 |
|
|
| 78 |
65 |
$(usex nls '' '--disable-nls')
|
| 79 |
66 |
|
| 80 |
67 |
# Disable automagic dependency over libsigsegv; see bug #278026
|
| ... | ... | |
| 85 |
72 |
}
|
| 86 |
73 |
|
| 87 |
74 |
src_test() {
|
| 88 |
|
[[ -d /none ]] && die "m4 tests will fail with /none/" #244396
|
|
75 |
[[ -d /none ]] && die "m4 tests will fail with /none/" # bug #244396
|
| 89 |
76 |
emake check
|
| 90 |
77 |
}
|
| 91 |
78 |
|