From owner-svn-ports-head@freebsd.org Sat Dec 14 16:48:36 2019 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 012F91D1F3D; Sat, 14 Dec 2019 16:48:36 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZtlR6CY0z4XN4; Sat, 14 Dec 2019 16:48:35 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC02A2789F; Sat, 14 Dec 2019 16:48:35 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBEGmZYk023404; Sat, 14 Dec 2019 16:48:35 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBEGmZDT023403; Sat, 14 Dec 2019 16:48:35 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <201912141648.xBEGmZDT023403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Sat, 14 Dec 2019 16:48:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r520132 - in head/misc/py-tvm: . files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/misc/py-tvm: . files X-SVN-Commit-Revision: 520132 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 16:48:36 -0000 Author: yuri Date: Sat Dec 14 16:48:35 2019 New Revision: 520132 URL: https://svnweb.freebsd.org/changeset/ports/520132 Log: misc/py-tvm: Add the 'topi' add-on python module that is required to also be built by py-tvm Added: head/misc/py-tvm/files/ head/misc/py-tvm/files/patch-python_tvm___ffi_libinfo.py (contents, props changed) Modified: head/misc/py-tvm/Makefile Modified: head/misc/py-tvm/Makefile ============================================================================== --- head/misc/py-tvm/Makefile Sat Dec 14 16:26:07 2019 (r520131) +++ head/misc/py-tvm/Makefile Sat Dec 14 16:48:35 2019 (r520132) @@ -3,6 +3,7 @@ PORTNAME= tvm DISTVERSIONPREFIX= v DISTVERSION= 0.6.0 +PORTREVISION= 1 CATEGORIES= misc # machine-learning PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -22,23 +23,33 @@ USES= python USE_GITHUB= yes GH_ACCOUNT= apache GH_PROJECT= incubator-tvm -USE_PYTHON= distutils autoplist +USE_PYTHON= distutils noegginfo GH_TUPLE= dmlc:dlpack:0acb731:dlpack/3rdparty/dlpack \ dmlc:dmlc-core:808f485:dmlc_core/3rdparty/dmlc-core BUILD_WRKSRC= ${WRKSRC}/python INSTALL_WRKSRC= ${WRKSRC}/python +BUILD_WRKSRC_TOPI= ${WRKSRC}/topi/python +INSTALL_WRKSRC_TOPI= ${WRKSRC}/topi/python -POST_PLIST= fix-plist # https://github.com/apache/incubator-tvm/issues/4411 +MAKE_ENV+= FREEBSD_LIBRARY_PATH=${LOCALBASE}/lib post-patch: - @${REINPLACE_CMD} 's|dll_path = \[\]|dll_path = ["${LOCALBASE}/lib"]|' ${BUILD_WRKSRC}/tvm/_ffi/libinfo.py + @${REINPLACE_CMD} 's|dll_path = \[\]|dll_path = ["${LOCALBASE}/lib"]|' ${WRKSRC}/python/tvm/_ffi/libinfo.py -fix-plist: - @${REINPLACE_CMD} -e "s|^tvm.*||" ${TMPPLIST} +post-configure: + @cd ${BUILD_WRKSRC_TOPI} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_CONFIGURE_TARGET} ${PYDISTUTILS_CONFIGUREARGS} -post-stage: - @${RM} -r ${STAGEDIR}${PREFIX}/tvm # see fix-plist +post-build: + @cd ${BUILD_WRKSRC_TOPI} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_BUILD_TARGET} ${PYDISTUTILS_BUILDARGS} + +post-install: + @cd ${INSTALL_WRKSRC_TOPI} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} ${PYDISTUTILS_INSTALL_TARGET} ${PYDISTUTILS_INSTALLARGS} + @${RM} -r ${STAGEDIR}${PREFIX}/tvm ${STAGEDIR}${PREFIX}/topi + @${RM} ${STAGEDIR}${PREFIX}/topi/libtvm_topi.so @${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name "*.so" | ${XARGS} ${STRIP_CMD} + # autoplist because 1) python's autoplist is inaccurate for tvm and 2) because there's the add-on package topi + @cd ${STAGEDIR}${PREFIX} && \ + ${FIND} ${PYTHON_SITELIBDIR:C|${LOCALBASE}/||} -type f -or -type l >> ${TMPPLIST} .include Added: head/misc/py-tvm/files/patch-python_tvm___ffi_libinfo.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/misc/py-tvm/files/patch-python_tvm___ffi_libinfo.py Sat Dec 14 16:48:35 2019 (r520132) @@ -0,0 +1,11 @@ +--- python/tvm/_ffi/libinfo.py.orig 2019-11-27 03:24:12 UTC ++++ python/tvm/_ffi/libinfo.py +@@ -72,6 +72,8 @@ def find_lib_path(name=None, search_path=None, optiona + if sys.platform.startswith('linux'): + dll_path.extend(split_env_var('LD_LIBRARY_PATH', ':')) + dll_path.extend(split_env_var('PATH', ':')) ++ elif sys.platform.startswith('freebsd'): ++ dll_path.extend(split_env_var('FREEBSD_LIBRARY_PATH', ':')) + elif sys.platform.startswith('darwin'): + dll_path.extend(split_env_var('DYLD_LIBRARY_PATH', ':')) + dll_path.extend(split_env_var('PATH', ':'))