diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2024-03-06 21:20:41 -0500 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-03-07 11:46:25 +0000 |
commit | a15989d262b96617d9b163afee720aab041be3c2 (patch) | |
tree | 8b7fbf69f3f4394f55a9a506a883af338996f336 /sci-physics/siscone | |
parent | app-portage/ufed: update EAPI 7 -> 8 (diff) | |
download | gentoo-a15989d262b96617d9b163afee720aab041be3c2.tar.gz gentoo-a15989d262b96617d9b163afee720aab041be3c2.tar.bz2 gentoo-a15989d262b96617d9b163afee720aab041be3c2.zip |
sci-physics/siscone: fix some critical existence failures in autoconf
Ancient 2008 macros that don't work and have been updated, and other
bashisms.
Closes: https://bugs.gentoo.org/890780
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-physics/siscone')
-rw-r--r-- | sci-physics/siscone/files/0001-configure-fix-broken-bashisms-resulting-in-logic-fai.patch | 71 | ||||
-rw-r--r-- | sci-physics/siscone/siscone-3.0.5.ebuild | 21 |
2 files changed, 91 insertions, 1 deletions
diff --git a/sci-physics/siscone/files/0001-configure-fix-broken-bashisms-resulting-in-logic-fai.patch b/sci-physics/siscone/files/0001-configure-fix-broken-bashisms-resulting-in-logic-fai.patch new file mode 100644 index 000000000000..33e56b5e188b --- /dev/null +++ b/sci-physics/siscone/files/0001-configure-fix-broken-bashisms-resulting-in-logic-fai.patch @@ -0,0 +1,71 @@ +From fd2218e4a671f4aae752620481e541799585fa20 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz <eschwartz93@gmail.com> +Date: Wed, 6 Mar 2024 20:06:07 -0500 +Subject: [PATCH] configure: fix broken bashisms resulting in logic failure + +In a configure check that was carefully written for pre-unix-wars +versions of the bourne shell, some code which was only valid using GNU +bash was included. + +Bash provides the standard `test XXX = YYY` or `[ XXX = YYY ]` +utilities. It also provides the ability to spell the equals sign as a +double equals. This does nothing whatsoever -- it adds no new +functionality to bash, it forbids nothing, it is *literally* an exact +alias. + +It should never be used under any circumstances. All developers must +immediately forget that it exists. Using it is non-portable and does not +work in /bin/sh scripts such as configure scripts, and it results in +dangerous muscle memory when used in bash scripts because it makes +people unthinkingly use the double equals even in /bin/sh scripts. To +add insult to injury, it makes scripts take up more disk space (by a +whole byte! and sometimes even a few bytes...) + +Delete this accidental bashism, and restore the ability to get correct +./configure behavior on systems where /bin/sh is something other than a +symlink to GNU bash. + +Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> +--- + configure.ac | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c0ac33c..619e162 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -44,7 +44,7 @@ AC_ARG_ENABLE(debug, + [ --enable-debug Turn on debug compiler information], + [ENABLE_DEBUG_FLAG="$enableval"], + [ENABLE_DEBUG_FLAG="yes"]) +-if [[ "x$ENABLE_DEBUG_FLAG" == "xyes" ]] ; then ++if test "$ENABLE_DEBUG_FLAG" = yes ; then + CXXFLAGS=${CXXFLAGS}" -g " + fi + +@@ -63,7 +63,7 @@ dnl AM_LDFLAGS=" -lm " + dnl if the debug flags are on, check if we can also use + dnl some profiling tools + dnl COMMENTED: Pass LDFLAGS to configure instead +-dnl if [[ "x$ENABLE_DEBUG_FLAG" == "xyes" ]] ; then ++dnl if test "$ENABLE_DEBUG_FLAG" = yes ; then + dnl AC_CHECK_LIB(profiler, google_initializer_module_profiler) + dnl AC_CHECK_LIB(pthread, pthread_create) + dnl AC_CHECK_LIB(tcmalloc, malloc) +@@ -81,11 +81,11 @@ CXXFLAGS="$CXXFLAGS -Werror=deprecated-declarations" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <memory>]],[[int *a= new int(1); std::auto_ptr<int> b; b.reset(a);]])], + [ac_compilation_deprecated="no"],[ac_compilation_deprecated="yes"]) + AC_MSG_RESULT([$ac_compilation_deprecated]) +-if [[ "$ac_compilation_deprecated" == "yes" ]] ; then ++if test "$ac_compilation_deprecated" = yes ; then + AC_MSG_CHECKING([[if $CXX $CXXFLAGS supports atd::unique_ptr]]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <memory>]],[[int *a= new int(1); std::unique_ptr<int> b; b.reset(a);]])], + [ac_supports_unique_ptr="yes"],[as_supports_unique_ptr="no"]) +- if [[ "$ac_supports_unique_ptr" == "yes" ]] ; then ++ if test "$ac_supports_unique_ptr" = "yes" ; then + AC_DEFINE(USES_UNIQUE_PTR_AS_AUTO_PTR, [], [use unique_ptr instead of auto_ptr]) + fi + AC_MSG_RESULT([$ac_supports_unique_ptr]) +-- +2.43.0 + diff --git a/sci-physics/siscone/siscone-3.0.5.ebuild b/sci-physics/siscone/siscone-3.0.5.ebuild index d66ff8180740..1205f84ddbbf 100644 --- a/sci-physics/siscone/siscone-3.0.5.ebuild +++ b/sci-physics/siscone/siscone-3.0.5.ebuild @@ -1,8 +1,10 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 +inherit autotools + DESCRIPTION="Hadron Seedless Infrared-Safe Cone jet algorithm" HOMEPAGE="https://siscone.hepforge.org/" SRC_URI="https://siscone.hepforge.org/downloads/${P}.tar.gz" @@ -12,6 +14,23 @@ SLOT="0" KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" IUSE="examples" +BDEPEND="dev-build/autoconf-archive" + +PATCHES=( + "${FILESDIR}"/0001-configure-fix-broken-bashisms-resulting-in-logic-fai.patch +) + +src_prepare() { + default + + # The included copy of this macro is from 2008 and totally broken. + # https://bugs.gentoo.org/890780 + rm m4/ax_prefix_config_h.m4 || die + + # Rebuild after patch to configure.ac, removal of broken macro + eautoreconf +} + src_configure() { econf --disable-static } |