summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2024-03-11 21:56:27 -0400
committerMichael Orlitzky <mjo@gentoo.org>2024-03-11 21:59:17 -0400
commit177ed9f2185d6f1f7b64a475169a9ed0b18989b8 (patch)
treee31589e6271e923eb8f4a62ce8150004bba788e0 /sci-mathematics/nauty
parentsys-apps/baselayout: add 2.15 (diff)
downloadgentoo-177ed9f2185d6f1f7b64a475169a9ed0b18989b8.tar.gz
gentoo-177ed9f2185d6f1f7b64a475169a9ed0b18989b8.tar.bz2
gentoo-177ed9f2185d6f1f7b64a475169a9ed0b18989b8.zip
sci-mathematics/nauty: fix build with autoconf-2.72
New patch fixes AC_SYS_LARGEFILE issues. Thanks to Dima Pasechnik for doing the legwork. Closes: https://bugs.gentoo.org/921138 Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'sci-mathematics/nauty')
-rw-r--r--sci-mathematics/nauty/files/nauty-2.8.8-autoconf-2.72.patch53
-rw-r--r--sci-mathematics/nauty/nauty-2.8.8-r1.ebuild80
2 files changed, 133 insertions, 0 deletions
diff --git a/sci-mathematics/nauty/files/nauty-2.8.8-autoconf-2.72.patch b/sci-mathematics/nauty/files/nauty-2.8.8-autoconf-2.72.patch
new file mode 100644
index 000000000000..db8fa5e699c0
--- /dev/null
+++ b/sci-mathematics/nauty/files/nauty-2.8.8-autoconf-2.72.patch
@@ -0,0 +1,53 @@
+diff --git a/configure.ac b/configure.ac
+index 5f28e30..69d42ff 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -186,9 +186,18 @@ dnl AC_PROG_CC
+ dnl CFLAGS=$user_cflags
+ MORECFLAGS=""
+ dnl we need AC_SYS_LARGEFILE and AC_FUNC_FSEEKO
++LARGEFILECFLAGS=""
+ AC_SYS_LARGEFILE
+-AS_IF([test "x$ac_cv_sys_file_offset_bits" = xno],[ac_cv_sys_file_offset_bits=0])
+-AC_SUBST(ac_cv_sys_file_offset_bits)
++dnl AS_IF([test "x$ac_cv_sys_file_offset_bits" = xno],[ac_cv_sys_file_offset_bits=0])
++dnl AC_SUBST(ac_cv_sys_file_offset_bits
++AS_CASE([$ac_cv_sys_largefile_opts],
++ ["none needed"], [],
++ ["support not detected"], [],
++ dnl otherwise it is a compiler flag
++ [LARGEFILECFLAGS="$ac_cv_sys_largefile_opts"]
++ )
++MORECFLAGS="$LARGEFILECFLAGS"
++AC_SUBST(LARGEFILECFLAGS)
+
+ dnl AS_IF([test "x$user_cflags" = x || test "x$user_cflags" = x-m32],
+ dnl [
+diff --git a/nauty-h.in b/nauty-h.in
+index ae65bc9..51508d9 100644
+--- a/nauty-h.in
++++ b/nauty-h.in
+@@ -60,13 +60,6 @@ it is necessary to check they are correct.
+ #define FLEX_ARRAY_OK @flex_array_ok@
+ /* whether the compiler supports flexible array members in structures */
+
+-#define _FILE_OFFSET_BITS @ac_cv_sys_file_offset_bits@
+-#if _FILE_OFFSET_BITS == 64
+-#define _LARGEFILE_SOURCE
+-#else
+-#undef _FILE_OFFSET_BITS
+-#endif
+-
+ /* Support of gcc extensions __builtin_clz, __builtin_clzl, __builtin_clzll */
+ #ifndef HAVE_HWLZCNT
+ #define HAVE_HWLZCNT @have_hwlzcnt@
+diff --git a/nauty-pc.in b/nauty-pc.in
+index cde86b3..c0bcef8 100644
+--- a/nauty-pc.in
++++ b/nauty-pc.in
+@@ -9,4 +9,4 @@ Version: @PACKAGE_VERSION@
+ URL: @PACKAGE_URL@
+ Libs: -L${libdir} -l@PACKAGE@
+ Libs.private: -lpthread
+-Cflags: -I${includedir}
++Cflags: -I${includedir} @LARGEFILECFLAGS@
diff --git a/sci-mathematics/nauty/nauty-2.8.8-r1.ebuild b/sci-mathematics/nauty/nauty-2.8.8-r1.ebuild
new file mode 100644
index 000000000000..af2ba2a10de8
--- /dev/null
+++ b/sci-mathematics/nauty/nauty-2.8.8-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+MY_PV=${PV//./_}
+DEBIAN_PATCH_VERSION=1
+
+DESCRIPTION="Computing automorphism groups of graphs and digraphs"
+HOMEPAGE="https://pallini.di.uniroma1.it/"
+
+SRC_URI="https://pallini.di.uniroma1.it/${PN}${MY_PV}.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}+ds-${DEBIAN_PATCH_VERSION}.debian.tar.xz
+ https://src.fedoraproject.org/rpms/nauty/raw/rawhide/f/nauty-includes.patch"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~riscv ~x86"
+IUSE="cpu_flags_x86_popcnt examples"
+
+BDEPEND="sys-apps/help2man"
+DEPEND="dev-libs/gmp:0
+ sys-libs/zlib
+ sci-mathematics/cliquer"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}${MY_PV}"
+
+DOCS=( schreier.txt formats.txt changes24-28.txt )
+
+PATCHES=(
+ "${WORKDIR}/debian/patches/upstream-fix-gt_numorbits.patch"
+ "${WORKDIR}/debian/patches/upstream-zlib-dimacs2g.patch"
+ "${WORKDIR}/debian/patches/upstream-C2help2man.patch"
+ "${WORKDIR}/debian/patches/upstream-autotoolization.patch"
+ "${DISTDIR}/nauty-includes.patch"
+ "${WORKDIR}/debian/patches/unbundle-cliquer.patch"
+ "${WORKDIR}/debian/patches/format.patch"
+ "${WORKDIR}/debian/patches/uninitialized.patch"
+ "${WORKDIR}/debian/patches/fall-off.patch"
+ "${WORKDIR}/debian/patches/noreturn.patch"
+ "${FILESDIR}/${P}-autoconf-2.72.patch"
+)
+
+src_prepare() {
+ default
+ rm makefile || die
+
+ # The debian patch looks for <cliquer.h>, but the autotools-form of
+ # cliquer installs that header as <cliquer/cliquer.h>.
+ sed -e 's~<cliquer\.h>~<cliquer/cliquer\.h>~' -i nautycliquer.h || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-static \
+ --enable-tls \
+ --enable-generic \
+ $(use_enable cpu_flags_x86_popcnt popcnt)
+}
+
+src_test() {
+ # It arrives non-executable in v2.8.8.
+ chmod +x runalltests || die
+ default
+}
+
+src_install() {
+ default
+
+ if use examples; then
+ docinto examples
+ dodoc nautyex*.c
+ fi
+
+ find "${ED}" -name '*.la' -delete || die
+}