commit:     c54c14fb2f0bc0892d35ab3c07629ea1bc1419e5
Author:     Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 19 16:58:23 2017 +0000
Commit:     Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
CommitDate: Wed Jul 19 17:00:06 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c54c14fb

sci-libs/dmlc-core: initial import

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 sci-libs/dmlc-core/Manifest                        |  1 +
 sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild    | 97 ++++++++++++++++++++++
 .../dmlc-core/files/dmlc-core-install-dirs.patch   | 38 +++++++++
 sci-libs/dmlc-core/metadata.xml                    | 19 +++++
 4 files changed, 155 insertions(+)

diff --git a/sci-libs/dmlc-core/Manifest b/sci-libs/dmlc-core/Manifest
new file mode 100644
index 00000000000..04e132d07b5
--- /dev/null
+++ b/sci-libs/dmlc-core/Manifest
@@ -0,0 +1 @@
+DIST dmlc-core-0_p20170719.tar.gz 160242 SHA256 
7da1167ae29ccfbc0779ada2a00baa6581462dd06d0e6ac2f9eac0173b28dc60 SHA512 
2e2d79800839652772f07deb5ea3aa470cc5a18d2d0e480b8f4a1598aca72443546a438f3309708268cc49cf2d65684c3366cfc6c33c085baf1b804b4c04f02e
 WHIRLPOOL 
77bb23c9f3b3ba5cd1041026e2265caba0daea6235da13de4745ff7d3c2c3f71a616023f84629cb5b62f8a73d44099198ca718af556e81d3640d9b5387637e6b

diff --git a/sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild 
b/sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild
new file mode 100644
index 00000000000..351c6e894b2
--- /dev/null
+++ b/sci-libs/dmlc-core/dmlc-core-0_p20170719.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs cmake-utils
+
+DESCRIPTION="Common bricks library for building distributed machine learning."
+HOMEPAGE="https://github.com/dmlc/dmlc-core";
+
+if [[ ${PV} == *9999* ]] ; then
+       EGIT_REPO_URI="git://github.com/dmlc/dmlc-core.git"
+       inherit git-r3
+       KEYWORDS=""
+else
+       EGIT_COMMIT="54db57d5d1b2a7b93319053011802888b827a539"
+       inherit vcs-snapshot
+       KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+       SRC_URI="${HOMEPAGE}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+# hdfs needs big java hdfs not yet in portage
+# azure not yet in portage
+IUSE="doc openmp s3 test"
+
+RDEPEND="net-misc/curl[ssl]"
+DEPEND="${RDEPEND}
+       doc? ( app-doc/doxygen )
+       test? ( dev-cpp/gtest )
+"
+
+PATCHES=( "${FILESDIR}"/${PN}-install-dirs.patch )
+
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+       cmake-utils_src_prepare
+       # respect user flags (SSE2 does nothing more than adding -msse2)
+       # also doc install everything so remove
+       sed -e '/-O3/d' \
+               -e '/check_cxx.*SSE2/d' \
+               -i CMakeLists.txt || die
+       # all these hacks below to allow testing
+       sed -e 's|-O3||' -e 's|-lm|-lm -L$(LD_LIBRARY_PATH) -ldmlc|g' -i 
Makefile || die
+       sed -e "s|libdmlc.a||g" \
+               -i test/dmlc_test.mk test/unittest/dmlc_unittest.mk || die
+       cat <<-EOF > config.mk
+               USE_SSE=0
+               WITH_FPIC=1
+               USE_OPENMP=$(use openmp && echo 1 || echo 0)
+               USE_S3=$(use s3 && echo 1 || echo 0)
+               BUILD_TEST=$(use test && echo 1 || echo 0)
+               DMLC_CFLAGS=${CXXFLAGS}
+               DMLC_LDFLAGS=${LDFLAGS}
+       EOF
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_SHARED_LIBS=ON
+               -DUSE_S3="$(usex s3)"
+               -DUSE_OPENMP="$(usex openmp)"
+       )
+       cmake-utils_src_configure
+}
+
+src_compile() {
+       cmake-utils_src_compile
+       if use doc; then
+               doxygen doc/Doxyfile || die
+       fi
+}
+
+src_test() {
+       tc-export CXX
+       export LD_LIBRARY_PATH="${BUILD_DIR}"
+       emake test
+       test/unittest/dmlc_unittest || die
+}
+
+src_install() {
+       cmake-utils_src_install
+       if use doc; then
+               insinto /usr/share/doc/${PF}
+               doins -r doc/doxygen/html
+               docompress -x /usr/share/doc/${PF}/html
+       fi
+}

diff --git a/sci-libs/dmlc-core/files/dmlc-core-install-dirs.patch 
b/sci-libs/dmlc-core/files/dmlc-core-install-dirs.patch
new file mode 100644
index 00000000000..06f87f70175
--- /dev/null
+++ b/sci-libs/dmlc-core/files/dmlc-core-install-dirs.patch
@@ -0,0 +1,38 @@
+From 536ba11dfdaa7feacc7fe5726a3a50e4d663da13 Mon Sep 17 00:00:00 2001
+From: Maarten de Vries <[email protected]>
+Date: Fri, 26 May 2017 15:29:29 +0200
+Subject: [PATCH] Use GNUInstallDirs for standard conforming install target.
+
+---
+ CMakeLists.txt | 18 +++++++-----------
+ 1 file changed, 7 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0b3b3ec..316e2f5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -121,18 +121,13 @@ endif()
+ add_library(dmlc ${SOURCE})
+ target_link_libraries(dmlc ${dmlccore_LINKER_LIBS})
+ 
+-# ---[ Install Includes
+-if(INSTALL_INCLUDE_DIR)
+-  add_custom_command(TARGET dmlc POST_BUILD
+-    COMMAND ${CMAKE_COMMAND} -E copy_directory
+-    ${PROJECT_SOURCE_DIR}/include ${INSTALL_INCLUDE_DIR}/
+-    )
+-endif()
+-
+ # ---[ Install the archive static lib and header files
+-install(TARGETS dmlc ARCHIVE DESTINATION lib) 
+-install(DIRECTORY include DESTINATION .)
+-install(DIRECTORY doc DESTINATION .)
++include(GNUInstallDirs)
++install(TARGETS dmlc
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++)
++install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ # ---[ Linter target
+ if(MSVC)

diff --git a/sci-libs/dmlc-core/metadata.xml b/sci-libs/dmlc-core/metadata.xml
new file mode 100644
index 00000000000..7fb45e55273
--- /dev/null
+++ b/sci-libs/dmlc-core/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="project">
+    <email>[email protected]</email>
+    <name>Gentoo Science Project</name>
+  </maintainer>
+  <longdescription lang="en">
+    Distributed Machine Learning Common Codebase Core is the backbone
+    library to support all DMLC projects, offers the bricks to build
+    efficient and scalable distributed machine learning libraries. 
+  </longdescription>
+  <upstream>
+    <remote-id type="github">dmlc/dmlc-core</remote-id>
+  </upstream>
+  <use>
+    <flag name="s3">Support for the Amazon Simple Storage Service</flag>
+  </use>               
+</pkgmetadata>

Reply via email to