From nobody Wed May 10 04:21:06 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QGMKG4pSBz4B1NG; Wed, 10 May 2023 04:21:06 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QGMKG3jWCz46rJ; Wed, 10 May 2023 04:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683692466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zGyzkKabhU5Rm7aI/FjO4M0Tcd6qTb0RvR4CA87Oxaw=; b=Zi5U0mMcCK8lRqkmbHsP0u5vRBdwhBzmS/Kc0rFSaCf7PrYdJyBg6kJU6n2sPLbz2tlOA5 dBQ4LbfzSk5KYDUL3SQpdxbNiBd1GxYdunlDgHuzQT+9QTqdOpyLQRB79fu0MJK1xrXhoH DRM7aRw0vbs89rU78hDOdl0oi1EkzLLzh7klOF3xHgFvoH/V1x0BFpxvgUUzDq238BrCVh 9paHKzDJfZDuYZWiRlwCiQRrE58e7rmSiLefkxAD1c8nuD1vkAHmim1IF7srJksxUtDtiI 6Vjw9pHownQObJxrpt+3EVRu0Zf/6rEGQf8599gm7PPKuKlgHEQK7q+Y5XSaKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683692466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zGyzkKabhU5Rm7aI/FjO4M0Tcd6qTb0RvR4CA87Oxaw=; b=nzwHr7RV0C9DBhSZzmYFMVV/IDLawXdSEyfLPE9RbbWPKDVy4Dwwq6AqTwcPm4giboQ/yx ruNWzygVw3dKtYhaYDk4iNxjSvgPks1cFwA39aypYWw7u2MzU8qCDyB/pcfGr+vlRmDXVC bN0YVfVJN0cfmcxCL6LrQ3/ug2QtFIzO6SrkNAGUaE/xj1E59kDoBp20BMf6iewevEKeWY om454zzZjTpfl9x91vYX3cRBKiYXkVLY7x6Ciw444JtJC01z863ALPakWiqeZCYaScx991 /iqMgBj2Y2cb9hcY0YrxQ/2koDmkYbylaYbm0b7HqJQ0xww//mTQeCXV3GU5gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683692466; a=rsa-sha256; cv=none; b=aeP4JHjA17MSpktqaqjfImMTOoUY/Gd2ah0csNYzPKkSP+QvC76/Yej1IG0TVVYnZxX/QS HFKQEz9ftydlf1AvAQDX7rSEMbo/caKUhZU2i3yhZ69Wtw5Us93rd3Q9QiRo1TXZY4W+Ry tyM8vu0UOwLq4SYhbd3q4bnfUSlTT0VPA9BTQxSsyOM91dcTPabZd1K5J9zNAOgoRe/Ty7 7L/SgvLS3HaR8EFgUvm/Wjl7M1c83NimJYFUTqIS/zBt3IQ3IJtiD6g+v44Cju7/2fz85W OTCXiy88rapIevF8cNVk6tP1T9Rhq8itEUFQyb5BRYJn0pwjqrpaAy2eHJTBDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QGMKG2S6PzwYQ; Wed, 10 May 2023 04:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34A4L6Z3092901; Wed, 10 May 2023 04:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34A4L6ld092900; Wed, 10 May 2023 04:21:06 GMT (envelope-from git) Date: Wed, 10 May 2023 04:21:06 GMT Message-Id: <202305100421.34A4L6ld092900@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: e6eed9e9dfac - main - math/py-dgl: New port: Deep Graph Library List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6eed9e9dfac32f38fe14a050c10a3b650ec9db9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=e6eed9e9dfac32f38fe14a050c10a3b650ec9db9 commit e6eed9e9dfac32f38fe14a050c10a3b650ec9db9 Author: Yuri Victorovich AuthorDate: 2023-05-10 04:20:04 +0000 Commit: Yuri Victorovich CommitDate: 2023-05-10 04:21:01 +0000 math/py-dgl: New port: Deep Graph Library --- math/Makefile | 1 + math/py-dgl/Makefile | 75 ++++++++++++++++++++++ math/py-dgl/distinfo | 3 + math/py-dgl/files/patch-dgl___ffi_base.py | 11 ++++ math/py-dgl/files/patch-dgl_sparse_____init____.py | 11 ++++ math/py-dgl/files/patch-setup.py | 20 ++++++ math/py-dgl/pkg-descr | 2 + 7 files changed, 123 insertions(+) diff --git a/math/Makefile b/math/Makefile index 89cacac3a106..8a575f445e3a 100644 --- a/math/Makefile +++ b/math/Makefile @@ -905,6 +905,7 @@ SUBDIR += py-cyipopt SUBDIR += py-cypari2 SUBDIR += py-deap + SUBDIR += py-dgl SUBDIR += py-dionysus SUBDIR += py-disjoint-set SUBDIR += py-docplex diff --git a/math/py-dgl/Makefile b/math/py-dgl/Makefile new file mode 100644 index 000000000000..29ca98e069fe --- /dev/null +++ b/math/py-dgl/Makefile @@ -0,0 +1,75 @@ +PORTNAME= dgl +DISTVERSION= 1.1.0 +CATEGORIES= math python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Deep Graph Library +WWW= https://www.dgl.ai/ + +LICENSE= BSD3CLAUSE + +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \ + ${BACKEND_DEPENDS} +LIB_DEPENDS= libdgl.so:math/dgl +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}networkx>=2.2:math/py-networkx@${PY_FLAVOR} \ + ${PYNUMPY} \ + ${PYTHON_PKGNAMEPREFIX}psutil>=5.8.0:sysutils/py-psutil@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>=2.19.0:www/py-requests@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}scipy>=1.1.0:science/py-scipy@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}tqdm>0:misc/py-tqdm@${PY_FLAVOR} \ + ${BACKEND_DEPENDS} + +USES= python:3.7+ localbase +USE_PYTHON= distutils cython autoplist + +WRKSRC_SUBDIR= python + +USE_GITHUB= yes +GH_ACCOUNT= dmlc + +MAKE_ENV= DGL_LIBRARY_PATH=${LOCALBASE}/lib + +POST_PLIST= rm-tests-from-plist + +OPTIONS_RADIO= BACKEND +OPTIONS_RADIO_BACKEND= PYTORCH TENSORFLOW MXNET +OPTIONS_DEFAULT= PYTORCH + +PYTORCH_DESC= Use PyTorch backend +PYTORCH_VARS= BACKEND_DEPENDS=${PYTHON_PKGNAMEPREFIX}pytorch>0:misc/py-pytorch@${PY_FLAVOR} +PYTORCH_MAKE_ENV= DGLBACKEND=pytorch + +TENSORFLOW_DESC= Use TensorFlow backend +TENSORFLOW_VARS= BACKEND_DEPENDS=${PYTHON_PKGNAMEPREFIX}tensorflow>0:science/py-tensorflow@${PY_FLAVOR} +TENSORFLOW_MAKE_ENV= DGLBACKEND=tensorflow + +MXNET_DESC= Use MXNET backend +MXNET_VARS= BACKEND_DEPENDS=${PYTHON_PKGNAMEPREFIX}mxnet>0:misc/py-mxnet@${PY_FLAVOR} +MXNET_MAKE_ENV= DGLBACKEND=mxnet + +post-install: + # workaround for https://github.com/dmlc/dgl/issues/5665 + @${RM} ${STAGEDIR}${PREFIX}/dgl/libdgl.so + # remove empty dirs + @${RMDIR} \ + ${STAGEDIR}${PREFIX}/dgl/tensoradapter/pytorch \ + ${STAGEDIR}${PREFIX}/dgl/tensoradapter \ + ${STAGEDIR}${PREFIX}/dgl/dgl_sparse \ + ${STAGEDIR}${PREFIX}/dgl + # strip binaries + @${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/dgl/_ffi/_cy3/core${PYTHON_EXT_SUFFIX}.so + +rm-tests-from-plist: + # workaround for https://github.com/dmlc/dgl/issues/5665 + @${REINPLACE_CMD} ' \ + /dgl\/libdgl.so/d ; \ + ' ${TMPPLIST} + # remove empty dirs + @${REINPLACE_CMD} ' \ + /dgl\/tensoradapter\/pytorch/d ; \ + /dgl\/dgl_sparse/d ; \ + ' ${TMPPLIST} + +.include diff --git a/math/py-dgl/distinfo b/math/py-dgl/distinfo new file mode 100644 index 000000000000..df6d90d4640c --- /dev/null +++ b/math/py-dgl/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1683572138 +SHA256 (dmlc-dgl-1.1.0_GH0.tar.gz) = 71c8ba7777ffdca37638bc796524d42c51006fad385967fa140235b60aac0252 +SIZE (dmlc-dgl-1.1.0_GH0.tar.gz) = 5536874 diff --git a/math/py-dgl/files/patch-dgl___ffi_base.py b/math/py-dgl/files/patch-dgl___ffi_base.py new file mode 100644 index 000000000000..c602b49f29dc --- /dev/null +++ b/math/py-dgl/files/patch-dgl___ffi_base.py @@ -0,0 +1,11 @@ +--- dgl/_ffi/base.py.orig 2023-05-09 03:27:48 UTC ++++ dgl/_ffi/base.py +@@ -137,6 +137,8 @@ def load_tensor_adapter(backend, version): + version = version.split("+")[0] + if sys.platform.startswith("linux"): + basename = "libtensoradapter_%s_%s.so" % (backend, version) ++ elif sys.platform.startswith("freebsd"): ++ basename = "libtensoradapter_%s_%s.so" % (backend, version) + elif sys.platform.startswith("darwin"): + basename = "libtensoradapter_%s_%s.dylib" % (backend, version) + elif sys.platform.startswith("win"): diff --git a/math/py-dgl/files/patch-dgl_sparse_____init____.py b/math/py-dgl/files/patch-dgl_sparse_____init____.py new file mode 100644 index 000000000000..e4ef984e8187 --- /dev/null +++ b/math/py-dgl/files/patch-dgl_sparse_____init____.py @@ -0,0 +1,11 @@ +--- dgl/sparse/__init__.py.orig 2023-05-09 03:28:28 UTC ++++ dgl/sparse/__init__.py +@@ -22,6 +22,8 @@ def load_dgl_sparse(): + + if sys.platform.startswith("linux"): + basename = f"libdgl_sparse_pytorch_{version}.so" ++ elif sys.platform.startswith("freebsd"): ++ basename = f"libdgl_sparse_pytorch_{version}.so" + elif sys.platform.startswith("darwin"): + basename = f"libdgl_sparse_pytorch_{version}.dylib" + elif sys.platform.startswith("win"): diff --git a/math/py-dgl/files/patch-setup.py b/math/py-dgl/files/patch-setup.py new file mode 100644 index 000000000000..91c3c627d541 --- /dev/null +++ b/math/py-dgl/files/patch-setup.py @@ -0,0 +1,20 @@ +--- setup.py.orig 2023-05-08 19:54:39 UTC ++++ setup.py +@@ -49,6 +49,8 @@ def get_lib_path(): + def get_ta_lib_pattern(): + if sys.platform.startswith("linux"): + ta_lib_pattern = "libtensoradapter_*.so" ++ elif sys.platform.startswith("freebsd"): ++ ta_lib_pattern = "libtensoradapter_*.so" + elif sys.platform.startswith("darwin"): + ta_lib_pattern = "libtensoradapter_*.dylib" + elif sys.platform.startswith("win"): +@@ -60,6 +62,8 @@ def get_ta_lib_pattern(): + + def get_dgl_sparse_pattern(): + if sys.platform.startswith("linux"): ++ dgl_sparse_lib_pattern = "libdgl_sparse_*.so" ++ elif sys.platform.startswith("freebsd"): + dgl_sparse_lib_pattern = "libdgl_sparse_*.so" + elif sys.platform.startswith("darwin"): + dgl_sparse_lib_pattern = "libdgl_sparse_*.dylib" diff --git a/math/py-dgl/pkg-descr b/math/py-dgl/pkg-descr new file mode 100644 index 000000000000..459fb5664e85 --- /dev/null +++ b/math/py-dgl/pkg-descr @@ -0,0 +1,2 @@ +DGL is a Python package built to ease deep learning on graphs +on top of existing DL frameworks.