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