summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-12-03 05:13:03 +0000
committerSam James <sam@gentoo.org>2022-12-03 06:06:08 +0000
commit2273bd624c73d57d9ef25315f5f2410264488935 (patch)
tree7b060e99ee22304a9b53e8d6874da3e376b4778e /sci-mathematics/unuran
parentsci-mathematics/rngstreams: workaround configure w/ non-bash (diff)
downloadgentoo-2273bd624c73d57d9ef25315f5f2410264488935.tar.gz
gentoo-2273bd624c73d57d9ef25315f5f2410264488935.tar.bz2
gentoo-2273bd624c73d57d9ef25315f5f2410264488935.zip
sci-mathematics/unuran: add 1.9.0
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-mathematics/unuran')
-rw-r--r--sci-mathematics/unuran/Manifest1
-rw-r--r--sci-mathematics/unuran/files/unuran-1.9.0-configure-clang16.patch27
-rw-r--r--sci-mathematics/unuran/unuran-1.9.0.ebuild59
3 files changed, 87 insertions, 0 deletions
diff --git a/sci-mathematics/unuran/Manifest b/sci-mathematics/unuran/Manifest
index 55e7dd8c0dbd..0451dcefc7dd 100644
--- a/sci-mathematics/unuran/Manifest
+++ b/sci-mathematics/unuran/Manifest
@@ -1 +1,2 @@
DIST unuran-1.8.1.tar.gz 4409911 BLAKE2B 2b036032deaeae70aa6ef58124fc88e9c167ae7952d04cba4b50181fff4249eff88c20bbb667c5702899bc863745b6991ae842da86f6bc592b6635dc310ec544 SHA512 4d98861914afe39065ec31ee837c0e21e0fb4f4667f559dee38a7a5c4e06f0d09bd550b20d06321d1f5fcd4799d482a9eebc66ac35f8cd7fff834f536d24854c
+DIST unuran-1.9.0.tar.gz 3803126 BLAKE2B 20a88e9004d284983770364f35941f8ea66e1c68ef8c0ea210e1b12d9027947fbf723032f22f88b87c8f649ab52c904b460673cee8d78a52ff5196a6f4212d9c SHA512 8fe389f2fc569265e7bac2a5de3d12e4a6238076bff2a7e19842a57da314dfdca19ff5c398e24732883a19de794a65bab7d0663b4551c664562a3c93f2d87170
diff --git a/sci-mathematics/unuran/files/unuran-1.9.0-configure-clang16.patch b/sci-mathematics/unuran/files/unuran-1.9.0-configure-clang16.patch
new file mode 100644
index 000000000000..66a9d44538bb
--- /dev/null
+++ b/sci-mathematics/unuran/files/unuran-1.9.0-configure-clang16.patch
@@ -0,0 +1,27 @@
+https://src.fedoraproject.org/rpms/unuran/blob/4e6e6392ad892454339458b655fd0324e58de3b7/f/unuran-configure-c99.patch
+https://bugzilla.redhat.com/show_bug.cgi?id=2150308
+
+Avoid calling the undeclared exit function. Instead return
+from main. Implicit function declarations were removed from C99,
+and future compilers are likely to reject them.
+
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -14,7 +14,7 @@ int main (void)
+ nan = inf / inf;
+ /* nan = 0.0 / 0.0; */
+ status = (nan == nan);
+- exit (status);
++ return status;
+ }]])],
+ [ac_cv_c_ieee_comparisons="yes"],
+ [ac_cv_c_ieee_comparisons="no"],
+@@ -43,7 +43,7 @@ int main (void)
+ double x = 0.0;
+ double inf = 1.0 / x;
+ int status = (inf < DBL_MAX/2.);
+- exit (status);
++ return status;
+ }]])],
+ [ac_cv_c_divide_by_zero="yes"],
+ [ac_cv_c_divide_by_zero="no"],
diff --git a/sci-mathematics/unuran/unuran-1.9.0.ebuild b/sci-mathematics/unuran/unuran-1.9.0.ebuild
new file mode 100644
index 000000000000..971d2638952a
--- /dev/null
+++ b/sci-mathematics/unuran/unuran-1.9.0.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools out-of-source
+
+DESCRIPTION="Universal Non-Uniform Random number generator"
+HOMEPAGE="https://statmath.wu.ac.at/unuran/"
+SRC_URI="https://statmath.wu.ac.at/unuran/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples gsl prng +rngstreams"
+
+DEPEND="
+ gsl? ( sci-libs/gsl:= )
+ prng? ( sci-mathematics/prng )
+ rngstreams? ( sci-mathematics/rngstreams:= )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.9.0-configure-clang16.patch
+)
+
+src_prepare() {
+ default
+
+ # Clang 16
+ eautoreconf
+}
+
+my_src_configure() {
+ local udefault=builtin
+ use rngstreams && udefault=rngstream
+
+ CONFIG_SHELL="${BROOT}"/bin/bash econf \
+ --enable-shared \
+ --disable-static \
+ --with-urng-default="${udefault}" \
+ $(use_with gsl urng-gsl) \
+ $(use_with prng urng-prng) \
+ $(use_with rngstreams urng-rngstream)
+}
+
+my_src_install_all() {
+ use doc && dodoc doc/${PN}.pdf
+ einstalldocs
+
+ if use examples; then
+ rm examples/Makefile* || die
+ dodoc -r examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+
+ # no static archives
+ find "${D}" -name '*.la' -delete || die
+}