Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/scotch/
Date: Sun, 17 Oct 2021 07:57:45
Message-Id: 1634456962.6b490763a3817f269c4f05d3fbdb8485f62a0d1e.sam@gentoo
1 commit: 6b490763a3817f269c4f05d3fbdb8485f62a0d1e
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 17 07:49:22 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 17 07:49:22 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b490763
7
8 sci-libs/scotch: add 6.1.1
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sci-libs/scotch/Manifest | 1 +
13 sci-libs/scotch/scotch-6.1.1.ebuild | 174 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 175 insertions(+)
15
16 diff --git a/sci-libs/scotch/Manifest b/sci-libs/scotch/Manifest
17 index da7f4e25fe8..72617de9d6a 100644
18 --- a/sci-libs/scotch/Manifest
19 +++ b/sci-libs/scotch/Manifest
20 @@ -1,2 +1,3 @@
21 DIST scotch-v6.1.0.tar.gz 6292006 BLAKE2B 5b76b01c0fa752468a36830a15c190cd78efc851c3b6831eb2d16b7cf34a71d55463b266ffdee4c6addd4e66ca7caf75e63825051e600ee8a32494e5033cabbd SHA512 e6d217a23e39635f8749811a3fc64c8da14d0396a71b4042a4f8f3ce32ff1f0b4ed033ebae90f3785443dae9b35ded68ea512ed1e3e7f9ea9a471a499ae26b89
22 +DIST scotch-v6.1.1.tar.gz 6363384 BLAKE2B 337c81608fd245dde5b19bb6c79924e0ee80181ce3c935ae37e6248be2511a2f4d70bdda5b9217e5e1ed79fc00269de15755c3b6829579aa190ca6da9c3c2dac SHA512 daa62463f25416764250fe0452ae84bc6a2e485ee62a387418b4686c2ab93a2ca2d5a12cba922857c99a1c9ec67fc82951b0f9563ab97f5f3a6b86bb9da22b0c
23 DIST scotch_6.0.4_esmumps.tar.gz 4804966 BLAKE2B 63c058fac9206e70975463b1748eb5ce7cd2ba01d9fcbb28eba8f5914ac49a71fcf87941fafd6047712fa519f3b5523ce199bdf5228a8b094bbb465dd64a1083 SHA512 0fcf639ab1a09451256444005f1a4a739403159e3ab22c34fbcedc481be387cd4c86be6fb029b4b5816220564f64f662434bf7f1d3921ed18be081ae2a7a9ee2
24
25 diff --git a/sci-libs/scotch/scotch-6.1.1.ebuild b/sci-libs/scotch/scotch-6.1.1.ebuild
26 new file mode 100644
27 index 00000000000..659fc047fa8
28 --- /dev/null
29 +++ b/sci-libs/scotch/scotch-6.1.1.ebuild
30 @@ -0,0 +1,174 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +inherit toolchain-funcs flag-o-matic multilib
37 +
38 +SOVER=$(ver_cut 1)
39 +
40 +DESCRIPTION="Software for graph, mesh and hypergraph partitioning"
41 +HOMEPAGE="https://www.labri.u-bordeaux.fr/perso/pelegrin/scotch/ https://gitlab.inria.fr/scotch/scotch"
42 +SRC_URI="https://gitlab.inria.fr/${PN}/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.gz"
43 +S="${WORKDIR}/${PN}-v${PV}"
44 +
45 +LICENSE="CeCILL-2"
46 +SLOT="0/${SOVER}"
47 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
48 +IUSE="doc int64 mpi static-libs test tools threads"
49 +# bug #532620
50 +REQUIRED_USE="test? ( threads )"
51 +RESTRICT="!test? ( test )"
52 +
53 +DEPEND="
54 + sys-libs/zlib
55 + mpi? ( virtual/mpi )"
56 +RDEPEND="${DEPEND}"
57 +
58 +static_to_shared() {
59 + local libstatic=${1}; shift
60 + local libname=$(basename ${libstatic%.a})
61 + local soname=${libname}$(get_libname ${SOVER})
62 + local libdir=$(dirname ${libstatic})
63 +
64 + einfo "Making ${soname} from ${libstatic}"
65 + if [[ ${CHOST} == *-darwin* ]] ; then
66 + ${LINK:-$(tc-getCC)} ${LDFLAGS} \
67 + -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
68 + -Wl,-all_load -Wl,${libstatic} \
69 + "$@" -o ${libdir}/${soname} || die "${soname} failed"
70 + else
71 + ${LINK:-$(tc-getCC)} ${LDFLAGS} \
72 + -shared -Wl,-soname=${soname} \
73 + -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
74 + "$@" -o ${libdir}/${soname} || die "${soname} failed"
75 + VERS_COMP=${PV//.}
76 + [[ "${#VERS_COMP}" -gt 1 ]] && \
77 + ln -s ${soname} ${libdir}/${libname}$(get_libname ${SOVER})
78 + ln -s ${soname} ${libdir}/${libname}$(get_libname)
79 + fi
80 +}
81 +
82 +src_prepare() {
83 + default
84 + use int64 && append-cflags -DIDXSIZE64
85 + if use threads; then
86 + append-cflags "-DSCOTCH_PTHREAD_NUMBER=$(nproc)"
87 + else
88 + append-cflags "-DSCOTCH_PTHREAD_NUMBER=1"
89 + sed -i \
90 + -e 's/ -DSCOTCH_PTHREAD//' \
91 + src/Make.inc/Makefile.inc.i686_pc_linux3 || die
92 + fi
93 +
94 + # Be careful with replacing here, bug #577272
95 + sed -e "s/= gcc$/= $(tc-getCC)/" \
96 + -e "s/-O3/${CFLAGS} -pthread/" \
97 + -e "s/= ar$/= $(tc-getAR)/" \
98 + -e "s/= ranlib$/= $(tc-getRANLIB)/" \
99 + -e "s/= ranlib$/= $(tc-getRANLIB)/" \
100 + -e "/^LDFLAGS/ s/$/ ${LDFLAGS}/" \
101 + src/Make.inc/Makefile.inc.i686_pc_linux3 > src/Makefile.inc || die
102 +}
103 +
104 +src_compile() {
105 + emake -C src CLIBFLAGS=-fPIC scotch esmumps
106 + static_to_shared lib/libscotcherr.a
107 + static_to_shared lib/libscotcherrexit.a
108 + static_to_shared lib/libscotch.a -Llib -lz -lm -lrt -lpthread -lscotcherr
109 + static_to_shared lib/libesmumps.a -Llib -lscotch
110 + static_to_shared lib/libscotchmetis.a -Llib -lscotch
111 +
112 + if use mpi; then
113 + emake -C src CLIBFLAGS=-fPIC ptscotch ptesmumps
114 + export LINK=mpicc
115 + static_to_shared lib/libptscotcherr.a
116 + static_to_shared lib/libptscotcherrexit.a
117 + static_to_shared lib/libptscotch.a -Llib -lscotch -lptscotcherr -lz -lm -lrt
118 + static_to_shared lib/libptesmumps.a -Llib -lscotch -lptscotch
119 + static_to_shared lib/libptscotchparmetis.a -Llib -lscotch -lptscotch
120 + fi
121 + if use static-libs; then
122 + emake -C src clean
123 + emake -C src
124 + use mpi && emake -C src ptscotch
125 + fi
126 +}
127 +
128 +src_test() {
129 + tc-export FC
130 + LD_LIBRARY_PATH="${S}/lib" emake -C src check
131 +}
132 +
133 +src_install() {
134 + dolib.so lib/lib*$(get_libname)*
135 + use static-libs && dolib.a lib/*.a
136 +
137 + #install metis headers into a subdir
138 + #to allow usage of real metis and scotch
139 + #in the same code
140 + insinto /usr/include/scotch/metis
141 + doins include/*metis*
142 + rm include/*metis*
143 + insinto /usr/include/scotch
144 + doins include/*
145 +
146 + cat <<-EOF > scotchmetis.pc
147 + prefix=${EPREFIX}/usr
148 + libdir=\${prefix}/$(get_libdir)
149 + includedir=\${prefix}/include
150 + Name: scotchmetis
151 + Description: ${DESCRIPTION}
152 + Version: ${PV}
153 + URL: ${HOMEPAGE}
154 + Libs: -L\${libdir} -lscotchmetis -lscotcherr -lscotch
155 + Private: -lm -lz -lrt
156 + Cflags: -I\${includedir}/scotch/metis
157 + EOF
158 + insinto /usr/$(get_libdir)/pkgconfig
159 + doins scotchmetis.pc
160 +
161 + # not sure it is actually a full replacement of metis
162 + #alternatives_for metis scotch 0 \
163 + # /usr/$(get_libdir)/pkgconfig/metis.pc scotchmetis.pc
164 +
165 + if use mpi; then
166 + cat <<-EOF > ptscotchparmetis.pc
167 + prefix=${EPREFIX}/usr
168 + libdir=\${prefix}/$(get_libdir)
169 + includedir=\${prefix}/include
170 + Name: ptscotchparmetis
171 + Description: ${DESCRIPTION}
172 + Version: ${PV}
173 + URL: ${HOMEPAGE}
174 + Libs: -L\${libdir} -lptscotchparmetis -lptscotcherr -lptscotch
175 + Private: -lm -lz -lrt
176 + Cflags: -I\${includedir}/scotch/metis
177 + Requires: scotchmetis
178 + EOF
179 + insinto /usr/$(get_libdir)/pkgconfig
180 + doins ptscotchparmetis.pc
181 + # not sure it is actually a full replacement of parmetis
182 + #alternatives_for metis-mpi ptscotch 0 \
183 + # /usr/$(get_libdir)/pkgconfig/metis-mpi.pc ptscotchparmetis.pc
184 + fi
185 +
186 + dodoc README.txt
187 +
188 + if use tools; then
189 + local b m
190 + pushd bin > /dev/null || die
191 + for b in *; do
192 + newbin ${b} scotch_${b}
193 + done
194 + popd > /dev/null || die
195 +
196 + pushd man/man1 > /dev/null || die
197 + for m in *.1; do
198 + newman ${m} scotch_${m}
199 + done
200 + popd > /dev/null || die
201 + fi
202 +
203 + use doc && dodoc doc/*.pdf
204 +}