Gentoo Archives: gentoo-commits

From: Horea Christian <horea.christ@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/spams-python/
Date: Tue, 04 Sep 2018 09:40:19
Message-Id: 1536053990.49bf91cb6d8c71e1589dd9240ebf46d12181401b.chymera@gentoo
1 commit: 49bf91cb6d8c71e1589dd9240ebf46d12181401b
2 Author: Horea Christian <horea.christ <AT> yandex <DOT> com>
3 AuthorDate: Tue Sep 4 09:39:50 2018 +0000
4 Commit: Horea Christian <horea.christ <AT> gmail <DOT> com>
5 CommitDate: Tue Sep 4 09:39:50 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=49bf91cb
7
8 sci-libs/spams-python: new package
9
10 Package-Manager: Portage-2.3.48, Repoman-2.3.10
11
12 sci-libs/spams-python/metadata.xml | 24 ++++++++++++
13 sci-libs/spams-python/spams-python-2.6.ebuild | 55 +++++++++++++++++++++++++++
14 2 files changed, 79 insertions(+)
15
16 diff --git a/sci-libs/spams-python/metadata.xml b/sci-libs/spams-python/metadata.xml
17 new file mode 100644
18 index 000000000..d1fbb3db3
19 --- /dev/null
20 +++ b/sci-libs/spams-python/metadata.xml
21 @@ -0,0 +1,24 @@
22 +<?xml version="1.0" encoding="UTF-8"?>
23 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
24 +<pkgmetadata>
25 + <maintainer type="person">
26 + <email>horea.christ@×××××.com</email>
27 + <name>Horea Christian</name>
28 + </maintainer>
29 + <maintainer type="project">
30 + <email>sci@g.o</email>
31 + <name>Gentoo Science Project</name>
32 + </maintainer>
33 + <longdescription lang="en">
34 + SPAMS (SPArse Modeling Software) is an optimization toolbox for solving
35 + various sparse estimation problems, such as: Dictionary learning and
36 + matrix factorization (NMF, sparse PCA, ...); solving sparse decomposition
37 + problems with LARS, coordinate descent, OMP, SOMP, proximal methods; and
38 + Solving structured sparse decomposition problems (l1/l2, l1/linf, sparse
39 + group lasso, tree-structured regularization, structured sparsity with
40 + overlapping groups,...).
41 + </longdescription>
42 + <upstream>
43 + <remote-id type="github">samuelstjean/spams-python</remote-id>
44 + </upstream>
45 +</pkgmetadata>
46
47 diff --git a/sci-libs/spams-python/spams-python-2.6.ebuild b/sci-libs/spams-python/spams-python-2.6.ebuild
48 new file mode 100644
49 index 000000000..eb5d40777
50 --- /dev/null
51 +++ b/sci-libs/spams-python/spams-python-2.6.ebuild
52 @@ -0,0 +1,55 @@
53 +# Copyright 1999-2018 Gentoo Foundation
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=7
57 +
58 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
59 +
60 +inherit distutils-r1 toolchain-funcs
61 +
62 +DESCRIPTION="Optimization toolbox for solving various sparse estimation problems"
63 +HOMEPAGE="http://spams-devel.gforge.inria.fr/index.html"
64 +SRC_URI="https://github.com/samuelstjean/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
65 +
66 +LICENSE="GPL-3"
67 +SLOT="0"
68 +IUSE=""
69 +KEYWORDS="~amd64"
70 +
71 +DEPEND="
72 + dev-python/numpy[${PYTHON_USEDEP}]
73 + virtual/blas
74 + virtual/lapack
75 + "
76 +RDEPEND="${DEPEND}
77 + sci-libs/scipy[${PYTHON_USEDEP}]
78 + "
79 +
80 +pc_libdir() {
81 + $(tc-getPKG_CONFIG) --libs-only-L $@ | \
82 + sed -e 's/^-L//' -e 's/[ ]*-L/:/g' -e 's/[ ]*$//' -e 's|^,||'
83 +}
84 +
85 +pc_libs() {
86 + $(tc-getPKG_CONFIG) --libs-only-l $@ | \
87 + sed -e 's/[ ]-l*\(pthread\|m\)\([ ]\|$\)//g' \
88 + -e 's/^-l//' -e 's/[ ]*-l/,/g' -e 's/[ ]*$//' \
89 + | tr ',' '\n' | sort -u | tr '\n' ',' | sed -e 's|,$||'
90 +}
91 +pkg_pretend() {
92 + [[ ${MERGE_TYPE} != binary ]] && tc-check-openmp
93 +}
94 +
95 +pkg_setup() {
96 + [[ ${MERGE_TYPE} != binary ]] && tc-check-openmp
97 +}
98 +
99 +python_prepare_all() {
100 + local libdir="${EPREFIX}"/usr/$(get_libdir)
101 + MY_LAPACK=$(pc_libs lapack)
102 + MY_BLAS=$(pc_libs blas)
103 + MY_LIBDIRS="$(pc_libdir blas lapack)'${libdir}'"
104 + sed -i -e "s/'blas', 'lapack'/'${MY_BLAS}', '${MY_LAPACK}'/g" setup.py || die
105 + sed -i -e "s|libdirs = \[\]|libdirs = [${MY_LIBDIRS}]|g" setup.py || die
106 + distutils-r1_python_prepare_all
107 +}