Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/dmlc-core/, sci-libs/dmlc-core/files/
Date: Wed, 19 Jul 2017 17:00:31
Message-Id: 1500483606.c54c14fb2f0bc0892d35ab3c07629ea1bc1419e5.bicatali@gentoo
1 commit: c54c14fb2f0bc0892d35ab3c07629ea1bc1419e5
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 19 16:58:23 2017 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 19 17:00:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c54c14fb
7
8 sci-libs/dmlc-core: initial import
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 sci-libs/dmlc-core/Manifest | 1 +
13 sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild | 97 ++++++++++++++++++++++
14 .../dmlc-core/files/dmlc-core-install-dirs.patch | 38 +++++++++
15 sci-libs/dmlc-core/metadata.xml | 19 +++++
16 4 files changed, 155 insertions(+)
17
18 diff --git a/sci-libs/dmlc-core/Manifest b/sci-libs/dmlc-core/Manifest
19 new file mode 100644
20 index 00000000000..04e132d07b5
21 --- /dev/null
22 +++ b/sci-libs/dmlc-core/Manifest
23 @@ -0,0 +1 @@
24 +DIST dmlc-core-0_p20170719.tar.gz 160242 SHA256 7da1167ae29ccfbc0779ada2a00baa6581462dd06d0e6ac2f9eac0173b28dc60 SHA512 2e2d79800839652772f07deb5ea3aa470cc5a18d2d0e480b8f4a1598aca72443546a438f3309708268cc49cf2d65684c3366cfc6c33c085baf1b804b4c04f02e WHIRLPOOL 77bb23c9f3b3ba5cd1041026e2265caba0daea6235da13de4745ff7d3c2c3f71a616023f84629cb5b62f8a73d44099198ca718af556e81d3640d9b5387637e6b
25
26 diff --git a/sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild b/sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild
27 new file mode 100644
28 index 00000000000..351c6e894b2
29 --- /dev/null
30 +++ b/sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild
31 @@ -0,0 +1,97 @@
32 +# Copyright 1999-2017 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +inherit toolchain-funcs cmake-utils
38 +
39 +DESCRIPTION="Common bricks library for building distributed machine learning."
40 +HOMEPAGE="https://github.com/dmlc/dmlc-core"
41 +
42 +if [[ ${PV} == *9999* ]] ; then
43 + EGIT_REPO_URI="git://github.com/dmlc/dmlc-core.git"
44 + inherit git-r3
45 + KEYWORDS=""
46 +else
47 + EGIT_COMMIT="54db57d5d1b2a7b93319053011802888b827a539"
48 + inherit vcs-snapshot
49 + KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
50 + SRC_URI="${HOMEPAGE}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
51 +fi
52 +
53 +LICENSE="Apache-2.0"
54 +SLOT="0"
55 +
56 +# hdfs needs big java hdfs not yet in portage
57 +# azure not yet in portage
58 +IUSE="doc openmp s3 test"
59 +
60 +RDEPEND="net-misc/curl[ssl]"
61 +DEPEND="${RDEPEND}
62 + doc? ( app-doc/doxygen )
63 + test? ( dev-cpp/gtest )
64 +"
65 +
66 +PATCHES=( "${FILESDIR}"/${PN}-install-dirs.patch )
67 +
68 +pkg_pretend() {
69 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
70 +}
71 +
72 +pkg_setup() {
73 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
74 +}
75 +
76 +src_prepare() {
77 + cmake-utils_src_prepare
78 + # respect user flags (SSE2 does nothing more than adding -msse2)
79 + # also doc install everything so remove
80 + sed -e '/-O3/d' \
81 + -e '/check_cxx.*SSE2/d' \
82 + -i CMakeLists.txt || die
83 + # all these hacks below to allow testing
84 + sed -e 's|-O3||' -e 's|-lm|-lm -L$(LD_LIBRARY_PATH) -ldmlc|g' -i Makefile || die
85 + sed -e "s|libdmlc.a||g" \
86 + -i test/dmlc_test.mk test/unittest/dmlc_unittest.mk || die
87 + cat <<-EOF > config.mk
88 + USE_SSE=0
89 + WITH_FPIC=1
90 + USE_OPENMP=$(use openmp && echo 1 || echo 0)
91 + USE_S3=$(use s3 && echo 1 || echo 0)
92 + BUILD_TEST=$(use test && echo 1 || echo 0)
93 + DMLC_CFLAGS=${CXXFLAGS}
94 + DMLC_LDFLAGS=${LDFLAGS}
95 + EOF
96 +}
97 +
98 +src_configure() {
99 + local mycmakeargs=(
100 + -DBUILD_SHARED_LIBS=ON
101 + -DUSE_S3="$(usex s3)"
102 + -DUSE_OPENMP="$(usex openmp)"
103 + )
104 + cmake-utils_src_configure
105 +}
106 +
107 +src_compile() {
108 + cmake-utils_src_compile
109 + if use doc; then
110 + doxygen doc/Doxyfile || die
111 + fi
112 +}
113 +
114 +src_test() {
115 + tc-export CXX
116 + export LD_LIBRARY_PATH="${BUILD_DIR}"
117 + emake test
118 + test/unittest/dmlc_unittest || die
119 +}
120 +
121 +src_install() {
122 + cmake-utils_src_install
123 + if use doc; then
124 + insinto /usr/share/doc/${PF}
125 + doins -r doc/doxygen/html
126 + docompress -x /usr/share/doc/${PF}/html
127 + fi
128 +}
129
130 diff --git a/sci-libs/dmlc-core/files/dmlc-core-install-dirs.patch b/sci-libs/dmlc-core/files/dmlc-core-install-dirs.patch
131 new file mode 100644
132 index 00000000000..06f87f70175
133 --- /dev/null
134 +++ b/sci-libs/dmlc-core/files/dmlc-core-install-dirs.patch
135 @@ -0,0 +1,38 @@
136 +From 536ba11dfdaa7feacc7fe5726a3a50e4d663da13 Mon Sep 17 00:00:00 2001
137 +From: Maarten de Vries <maarten@××××××.es>
138 +Date: Fri, 26 May 2017 15:29:29 +0200
139 +Subject: [PATCH] Use GNUInstallDirs for standard conforming install target.
140 +
141 +---
142 + CMakeLists.txt | 18 +++++++-----------
143 + 1 file changed, 7 insertions(+), 11 deletions(-)
144 +
145 +diff --git a/CMakeLists.txt b/CMakeLists.txt
146 +index 0b3b3ec..316e2f5 100644
147 +--- a/CMakeLists.txt
148 ++++ b/CMakeLists.txt
149 +@@ -121,18 +121,13 @@ endif()
150 + add_library(dmlc ${SOURCE})
151 + target_link_libraries(dmlc ${dmlccore_LINKER_LIBS})
152 +
153 +-# ---[ Install Includes
154 +-if(INSTALL_INCLUDE_DIR)
155 +- add_custom_command(TARGET dmlc POST_BUILD
156 +- COMMAND ${CMAKE_COMMAND} -E copy_directory
157 +- ${PROJECT_SOURCE_DIR}/include ${INSTALL_INCLUDE_DIR}/
158 +- )
159 +-endif()
160 +-
161 + # ---[ Install the archive static lib and header files
162 +-install(TARGETS dmlc ARCHIVE DESTINATION lib)
163 +-install(DIRECTORY include DESTINATION .)
164 +-install(DIRECTORY doc DESTINATION .)
165 ++include(GNUInstallDirs)
166 ++install(TARGETS dmlc
167 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
168 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
169 ++)
170 ++install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
171 +
172 + # ---[ Linter target
173 + if(MSVC)
174
175 diff --git a/sci-libs/dmlc-core/metadata.xml b/sci-libs/dmlc-core/metadata.xml
176 new file mode 100644
177 index 00000000000..7fb45e55273
178 --- /dev/null
179 +++ b/sci-libs/dmlc-core/metadata.xml
180 @@ -0,0 +1,19 @@
181 +<?xml version="1.0" encoding="UTF-8"?>
182 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
183 +<pkgmetadata>
184 + <maintainer type="project">
185 + <email>sci-mathematics@g.o</email>
186 + <name>Gentoo Science Project</name>
187 + </maintainer>
188 + <longdescription lang="en">
189 + Distributed Machine Learning Common Codebase Core is the backbone
190 + library to support all DMLC projects, offers the bricks to build
191 + efficient and scalable distributed machine learning libraries.
192 + </longdescription>
193 + <upstream>
194 + <remote-id type="github">dmlc/dmlc-core</remote-id>
195 + </upstream>
196 + <use>
197 + <flag name="s3">Support for the Amazon Simple Storage Service</flag>
198 + </use>
199 +</pkgmetadata>