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: Sat, 19 Feb 2022 22:37:56
Message-Id: 1645310253.4da6773013ed9699393143b73b5cbb76131887d8.sam@gentoo
1 commit: 4da6773013ed9699393143b73b5cbb76131887d8
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 19 21:03:06 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 19 22:37:33 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4da67730
7
8 sci-libs/scotch: add 7.0.1
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sci-libs/scotch/Manifest | 1 +
13 sci-libs/scotch/scotch-7.0.1.ebuild | 176 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 177 insertions(+)
15
16 diff --git a/sci-libs/scotch/Manifest b/sci-libs/scotch/Manifest
17 index fcf76ab6b400..9c1ce2781f46 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-v7.0.1.tar.gz 6838403 BLAKE2B 48cb928bf8586bbbe206dcb4f685e6c392ae078f5493e0384776cf6788137361286adbebceb7ad5c171eced34f5dda3f4852092413e79cbb791bd3ced204784c SHA512 c3267d5c8785a2258af3baf999d2c1eb75ef361062e74962b6e985a75cc4f5ef1f79919759ba1b7cf028f94d06a5ddf3818108a97eca4123a11d7750b5d7093d
25
26 diff --git a/sci-libs/scotch/scotch-7.0.1.ebuild b/sci-libs/scotch/scotch-7.0.1.ebuild
27 new file mode 100644
28 index 000000000000..5f7ec4a8c16f
29 --- /dev/null
30 +++ b/sci-libs/scotch/scotch-7.0.1.ebuild
31 @@ -0,0 +1,176 @@
32 +# Copyright 1999-2022 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/libscotchmetisv3.a -Llib -lscotch
112 + static_to_shared lib/libscotchmetisv5.a -Llib -lscotch
113 +
114 + if use mpi; then
115 + emake -C src CLIBFLAGS=-fPIC ptscotch ptesmumps
116 + export LINK=mpicc
117 + static_to_shared lib/libptscotcherr.a
118 + static_to_shared lib/libptscotcherrexit.a
119 + static_to_shared lib/libptscotch.a -Llib -lscotch -lptscotcherr -lz -lm -lrt
120 + static_to_shared lib/libptesmumps.a -Llib -lscotch -lptscotch
121 + static_to_shared lib/libptscotchparmetis.a -Llib -lscotch -lptscotch
122 + fi
123 + if use static-libs; then
124 + emake -C src clean
125 + emake -C src
126 + use mpi && emake -C src ptscotch
127 + fi
128 +}
129 +
130 +src_test() {
131 + tc-export FC
132 + LD_LIBRARY_PATH="${S}/lib" emake -C src check
133 +}
134 +
135 +src_install() {
136 + dolib.so lib/lib*$(get_libname)*
137 + use static-libs && dolib.a lib/*.a
138 +
139 + # Install metis headers into a subdir
140 + # to allow usage of real metis and scotch
141 + # in the same code
142 + insinto /usr/include/scotch/metis
143 + doins include/*metis*
144 + rm include/*metis* || die
145 +
146 + insinto /usr/include/scotch
147 + doins include/*
148 +
149 + cat <<-EOF > scotchmetis.pc
150 + prefix=${EPREFIX}/usr
151 + libdir=\${prefix}/$(get_libdir)
152 + includedir=\${prefix}/include
153 + Name: scotchmetis
154 + Description: ${DESCRIPTION}
155 + Version: ${PV}
156 + URL: ${HOMEPAGE}
157 + Libs: -L\${libdir} -lscotchmetis -lscotcherr -lscotch
158 + Private: -lm -lz -lrt
159 + Cflags: -I\${includedir}/scotch/metis
160 + EOF
161 + insinto /usr/$(get_libdir)/pkgconfig
162 + doins scotchmetis.pc
163 +
164 + # Not sure it is actually a full replacement of metis
165 + #alternatives_for metis scotch 0 \
166 + # /usr/$(get_libdir)/pkgconfig/metis.pc scotchmetis.pc
167 +
168 + if use mpi; then
169 + cat <<-EOF > ptscotchparmetis.pc
170 + prefix=${EPREFIX}/usr
171 + libdir=\${prefix}/$(get_libdir)
172 + includedir=\${prefix}/include
173 + Name: ptscotchparmetis
174 + Description: ${DESCRIPTION}
175 + Version: ${PV}
176 + URL: ${HOMEPAGE}
177 + Libs: -L\${libdir} -lptscotchparmetis -lptscotcherr -lptscotch
178 + Private: -lm -lz -lrt
179 + Cflags: -I\${includedir}/scotch/metis
180 + Requires: scotchmetis
181 + EOF
182 + insinto /usr/$(get_libdir)/pkgconfig
183 + doins ptscotchparmetis.pc
184 + # Not sure it is actually a full replacement of parmetis
185 + #alternatives_for metis-mpi ptscotch 0 \
186 + # /usr/$(get_libdir)/pkgconfig/metis-mpi.pc ptscotchparmetis.pc
187 + fi
188 +
189 + dodoc README.txt
190 +
191 + if use tools; then
192 + local b m
193 + pushd bin > /dev/null || die
194 + for b in *; do
195 + newbin ${b} scotch_${b}
196 + done
197 + popd > /dev/null || die
198 +
199 + pushd man/man1 > /dev/null || die
200 + for m in *.1; do
201 + newman ${m} scotch_${m}
202 + done
203 + popd > /dev/null || die
204 + fi
205 +
206 + use doc && dodoc doc/*.pdf
207 +}