Gentoo Archives: gentoo-commits

From: Amy Liffey <amynka@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/gsl/
Date: Mon, 06 Aug 2018 14:10:50
Message-Id: 1533564613.d605c4d73a17a910c6bf7d5ce3cced96d7fedab9.amynka@gentoo
1 commit: d605c4d73a17a910c6bf7d5ce3cced96d7fedab9
2 Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 6 14:10:13 2018 +0000
4 Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 6 14:10:13 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d605c4d7
7
8 sci-libs/gsl: version bump 2.5
9
10 Closes: https://bugs.gentoo.org/661380
11 Package-Manager: Portage-2.3.40, Repoman-2.3.9
12
13 sci-libs/gsl/Manifest | 1 +
14 sci-libs/gsl/gsl-2.5.ebuild | 112 ++++++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 113 insertions(+)
16
17 diff --git a/sci-libs/gsl/Manifest b/sci-libs/gsl/Manifest
18 index a5822d65a93..00fc6640e73 100644
19 --- a/sci-libs/gsl/Manifest
20 +++ b/sci-libs/gsl/Manifest
21 @@ -2,3 +2,4 @@ DIST gsl-1.16-cblas.patch.bz2 2810 BLAKE2B 364c9f93a386e5d95c86789a3c00231cdfbe5
22 DIST gsl-1.16.tar.gz 3534080 BLAKE2B 1c55a41e5ed57b57f671074240d23416aa8f23e3cc2bb832e455d4f44d307e6be6adfa3671dbbf2aa14604ea49f96ff636de7909f3532cdc811f6bd99b0aa59d SHA512 94e998953f30d701e1cd0a5e05d572c5cca7b6f40f0533aa85394ba4218946826408093ffe3049a0ab13d6ba87034fcec1a7d52a67d0b8860dc02b5fd4feb8eb
23 DIST gsl-2.3-cblas.patch.bz2 12036 BLAKE2B ddad801cc42f925581e2e4995292f3eab0d2faf70c43c3b205fcf521b98e426df1d0824ed7d98b2c4cc89bbc4068fd45f2595dc02d23bded5c702b5a01bbfdb2 SHA512 37b867a21e60cd96c453ae24139bcf16c00c85bb6d5a3dcece81185fd9af5870c5167d2fa3c74cffce55bfb84f72be34d28ea94e0889904f8dda8687f66b4d23
24 DIST gsl-2.4.tar.gz 5916715 BLAKE2B f22c07b2d5759a383e05b8bfdba70071672cc27f12ff2a8c755451fe7e10c8e2d80e3fcc601508c5e9942e4cfd05e51c43ba96666326b760e4390eb0c2552886 SHA512 12442b023dd959e8b22a9c486646b5cedec7fdba0daf2604cda365cf96d10d99aefdec2b42e59c536cc071da1525373454e5ed6f4b15293b305ca9b1dc6db130
25 +DIST gsl-2.5.tar.gz 7303881 BLAKE2B 7c6d10c21071a1af1f03123f83244476d2e90fcd27d05a115b03a74fe631eb7d8081f5260e534ae58ab0997c1111f980a5e4cb50d110ca626fe810c44be70180 SHA512 5b4c5c023f9029ce220f4e09aa4d0234fed94d42ac224d58fda095fe0532d54237a7c33278f8b5d0ba051f6004486edb38d0adb4fcb49337a8c1d8a18cf4a24a
26
27 diff --git a/sci-libs/gsl/gsl-2.5.ebuild b/sci-libs/gsl/gsl-2.5.ebuild
28 new file mode 100644
29 index 00000000000..da1026f0739
30 --- /dev/null
31 +++ b/sci-libs/gsl/gsl-2.5.ebuild
32 @@ -0,0 +1,112 @@
33 +# Copyright 1999-2018 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +inherit autotools flag-o-matic toolchain-funcs
39 +
40 +DESCRIPTION="The GNU Scientific Library"
41 +HOMEPAGE="https://www.gnu.org/software/gsl/"
42 +SRC_URI="mirror://gnu/${PN}/${P}.tar.gz
43 + https://dev.gentoo.org/~mgorny/dist/${PN}-2.3-cblas.patch.bz2"
44 +
45 +LICENSE="GPL-3"
46 +SLOT="0/23"
47 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x86-solaris"
48 +IUSE="cblas-external +deprecated static-libs"
49 +
50 +RDEPEND="cblas-external? ( virtual/cblas:= )"
51 +DEPEND="${RDEPEND}
52 + app-eselect/eselect-cblas
53 + virtual/pkgconfig"
54 +
55 +PATCHES=( "${WORKDIR}"/${PN}-2.3-cblas.patch )
56 +
57 +pkg_pretend() {
58 + # prevent to use external cblas from a previously installed gsl
59 + local current_lib
60 + if use cblas-external; then
61 + current_lib=$(eselect cblas show | cut -d' ' -f2)
62 + if [[ ${current_lib} == gsl ]]; then
63 + ewarn "USE flag cblas-external is set: linking gsl with an external cblas."
64 + ewarn "However the current selected external cblas is gsl."
65 + ewarn "Please install and/or eselect another cblas"
66 + die "Circular gsl dependency"
67 + fi
68 + fi
69 +}
70 +
71 +src_prepare() {
72 + ESELECT_PROF="gsl"
73 +
74 + # bug 349005
75 + [[ $(tc-getCC)$ == *gcc* ]] && \
76 + [[ $(tc-getCC)$ != *apple* ]] && \
77 + [[ $(gcc-major-version)$(gcc-minor-version) -eq 44 ]] \
78 + && filter-mfpmath sse
79 + filter-flags -ffast-math
80 +
81 + default
82 + if use deprecated; then
83 + sed -i -e "/GSL_DISABLE_DEPRECATED/,+2d" configure.ac || die
84 + fi
85 + eautoreconf
86 +
87 + cp "${FILESDIR}"/eselect.cblas.gsl "${T}"/ || die
88 + sed -i -e "s:/usr:${EPREFIX}/usr:" "${T}"/eselect.cblas.gsl || die
89 + if [[ ${CHOST} == *-darwin* ]] ; then
90 + sed -i -e 's/\.so\([\.0-9]\+\)\?/\1.dylib/g' \
91 + "${T}"/eselect.cblas.gsl || die
92 + fi
93 +}
94 +
95 +src_configure() {
96 + if use cblas-external; then
97 + export CBLAS_LIBS="$($(tc-getPKG_CONFIG) --libs cblas)"
98 + export CBLAS_CFLAGS="$($(tc-getPKG_CONFIG) --cflags cblas)"
99 + fi
100 + econf \
101 + --enable-shared \
102 + $(use_with cblas-external) \
103 + $(use_enable static-libs static)
104 +}
105 +
106 +src_test() {
107 + local MAKEOPTS="${MAKEOPTS} -j1"
108 + default
109 +}
110 +
111 +src_install() {
112 + default
113 +
114 + find "${ED}" -name '*.la' -exec rm -f {} +
115 +
116 + # take care of pkgconfig file for cblas implementation.
117 + sed \
118 + -e "s/@LIBDIR@/$(get_libdir)/" \
119 + -e "s/@PV@/${PV}/" \
120 + -e "/^prefix=/s:=:=${EPREFIX}:" \
121 + -e "/^libdir=/s:=:=${EPREFIX}:" \
122 + "${FILESDIR}"/cblas.pc.in > cblas.pc \
123 + || die "sed cblas.pc failed"
124 + insinto /usr/$(get_libdir)/blas/gsl
125 + doins cblas.pc
126 + eselect cblas add $(get_libdir) "${T}"/eselect.cblas.gsl \
127 + ${ESELECT_PROF}
128 +}
129 +
130 +pkg_postinst() {
131 + local p=cblas
132 + local current_lib=$(eselect ${p} show | cut -d' ' -f2)
133 + if [[ ${current_lib} == ${ESELECT_PROF} || -z ${current_lib} ]]; then
134 + # work around eselect bug #189942
135 + local configfile="${EROOT}"/etc/env.d/${p}/$(get_libdir)/config
136 + [[ -e ${configfile} ]] && rm -f ${configfile}
137 + eselect ${p} set ${ESELECT_PROF}
138 + elog "${p} has been eselected to ${ESELECT_PROF}"
139 + else
140 + elog "Current eselected ${p} is ${current_lib}"
141 + elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
142 + elog "\t eselect ${p} set ${ESELECT_PROF}"
143 + fi
144 +}