From nobody Fri Jul 28 07:45:25 2023 X-Original-To: dev-commits-ports-all@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 4RC06Y3QC9z4pfNl; Fri, 28 Jul 2023 07:45:25 +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 4RC06Y2VHFz4DjK; Fri, 28 Jul 2023 07:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690530325; 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=IoUblDA/obpzFyJhWtmSS5kE1pnMdtxWWE/IQcvDK1c=; b=H4C+Z7kBN1Ylra6UGTO64G3OkHuAPzDvkJHhRG+SLh5CCKEgmW8vqJQ16OBDe0P6M6ZC2O vnaS4zJcKd0oxfut2syA2oz84gI5LKBCx3A3KSvQXO52Zdha7ktLVEqVFPEQ0lNcvzvTHi FpWhBgJjXNfkaoHjC+WFCImgLVo+yD8AdvJRzoIfGNdblvv2EA0V3Pvz+APccnSxrA97+T /rASNsEZL/DVofGuJ2H/7b3Ijn3alotavZtSwMBesjKhvE1YBOgMiINCrFGiBbL2fcIMNK WepesmgKQ8A4yjTKPU7OvrqVA2pvwBLAKClXCwmrxHIUqaB8IvRPRLp/R8ulBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690530325; 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=IoUblDA/obpzFyJhWtmSS5kE1pnMdtxWWE/IQcvDK1c=; b=PGHXA9EBnea0cWiRAmAWXmRq0XVe1gQuh5alOZDG/QGWz5BoTTxn0SZ4v+PC5iB3R86hXO TF+CMAdIYMJWNCJYmYewzgN/p13KeMIXFuGbKKZ4NDZFpkzhz/hF5B+gISq1zv6Stf6CYg ar1WF16eX1f6xPlYbh+n4UgzGWrYN/UlJqdkWoTCaCcCYsv3D9jesB1u+/WETYnKUuI2OZ VR9KkNhkQYxPikrpYeUNQJr8/SBza5D4fBpUuPp6yXD8jhMPNHkxBWWSoWVi8pF/krN9KH fB6ij/RzbrklCchrblt3qXKQcRyrOxJCmE1oVwfC2T4so7IqYm5YoLFylAp2Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690530325; a=rsa-sha256; cv=none; b=r7s6jJJAL08RaT8g5gppvF5u2r0YqIEVOoYQbrMBMatulnKOrMYkRUE9kK/DJgzxFnOk5R rnqIp6zx6Emj3Rz385kYpKdU0JD2Y8uWaNfdbdCwTgnEl0/SKb+SM2TW3g9hTce/QlhEN8 hNbUVzumgIfekvgcLeHl19XNw06r0pEPwqEqJ4w1I72REXIuJvU1vOwpXgIvYQXcL8zbz2 O2a4m95txCvSZmeexkn9HJW5a9qkd3p/aEvvev+nOvoqA0YSb4pyE4C8sH1rcs7DSrWsTb 1RcyOIfdaRTzt3r1z9ELsfHt/XoaN/Xf6lOwtBSobltcCIsoUzTzA7VK46ROKw== 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 4RC06Y1ZdfzjhB; Fri, 28 Jul 2023 07:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36S7jPj6029817; Fri, 28 Jul 2023 07:45:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36S7jPOY029816; Fri, 28 Jul 2023 07:45:25 GMT (envelope-from git) Date: Fri, 28 Jul 2023 07:45:25 GMT Message-Id: <202307280745.36S7jPOY029816@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: 9c44a991ebea - main - cad/py-amaranth: New port: Amaranth hardware definition language List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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: 9c44a991ebeafa6a7a936a1d4b2971bbff650cee Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=9c44a991ebeafa6a7a936a1d4b2971bbff650cee commit 9c44a991ebeafa6a7a936a1d4b2971bbff650cee Author: Yuri Victorovich AuthorDate: 2023-07-28 07:44:49 +0000 Commit: Yuri Victorovich CommitDate: 2023-07-28 07:45:19 +0000 cad/py-amaranth: New port: Amaranth hardware definition language --- cad/Makefile | 1 + cad/py-amaranth/Makefile | 59 ++++++++++++++++++++++++++++++ cad/py-amaranth/distinfo | 3 ++ cad/py-amaranth/files/patch-pyproject.toml | 37 +++++++++++++++++++ cad/py-amaranth/pkg-descr | 12 ++++++ 5 files changed, 112 insertions(+) diff --git a/cad/Makefile b/cad/Makefile index 33ad61a3cdd6..bdb5c4d15857 100644 --- a/cad/Makefile +++ b/cad/Makefile @@ -103,6 +103,7 @@ SUBDIR += pcb SUBDIR += pcb-rnd SUBDIR += pdnmesh + SUBDIR += py-amaranth SUBDIR += py-cadquery SUBDIR += py-cocotb SUBDIR += py-cq-editor diff --git a/cad/py-amaranth/Makefile b/cad/py-amaranth/Makefile new file mode 100644 index 000000000000..5c7a2cdd8790 --- /dev/null +++ b/cad/py-amaranth/Makefile @@ -0,0 +1,59 @@ +PORTNAME= amaranth +DISTVERSIONPREFIX= v +DISTVERSION= 0.3-160 +DISTVERSIONSUFFIX= -gb952005 +CATEGORIES= cad python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Amaranth hardware definition language +WWW= https://amaranth-lang.org/docs/amaranth/latest/ + +LICENSE= BSD3CLAUSE + +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + ${PYTHON_PKGNAMEPREFIX}setuptools_scm>0:devel/py-setuptools_scm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=3.0:devel/py-Jinja2@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyvcd>0:cad/py-pyvcd@${PY_FLAVOR} + +USES= python +USE_PYTHON= pep517 autoplist pytest + +USE_GITHUB= yes +GH_ACCOUNT= amaranth-lang + +NO_ARCH= yes + +# workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272771 +PEP517_INSTALL_CMD= ${PYTHON_CMD} -m installer --destdir ${STAGEDIR} --prefix ${PREFIX} ${BUILD_WRKSRC}/dist/${PORTNAME:C|[-_]+|_|g}-${DISTVERSION:S/-/.post/}*.whl + +post-patch: + @${REINPLACE_CMD} \ + -e 's|from setuptools_scm.git import parse as parse_git|return "v${DISTVERSION}"|' \ + ${WRKSRC}/setup.py + @${REINPLACE_CMD} \ + -e 's|%%VERSION%%|${DISTVERSION}|' \ + ${WRKSRC}/pyproject.toml + +do-install: # workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272771 + @${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PEP517_INSTALL_CMD} + @${PYTHON_CMD} -B ${PORTSDIR}/Mk/Scripts/strip_RECORD.py \ + ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/${PORTNAME:C|[-_]+|_|g}-${DISTVERSION:S/-/.post/}*.dist-info/RECORD >> ${_PYTHONPKGLIST} + @${REINPLACE_CMD} \ + -e '/\.pyc$$/d' \ + -e 's|^|${PYTHONPREFIX_SITELIBDIR}/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../etc/|etc/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../bin/|bin/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../include/|include/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../lib/|lib/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../libdata/|libdata/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../libexec/|libexec/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../man/|man/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../sbin/|sbin/|' \ + -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../share/|share/|' \ + ${_PYTHONPKGLIST} + @cd ${STAGEDIR}${PREFIX} && ${FIND} lib -name '*.pyc' >> ${_PYTHONPKGLIST} + +.include diff --git a/cad/py-amaranth/distinfo b/cad/py-amaranth/distinfo new file mode 100644 index 000000000000..4bb3f520c209 --- /dev/null +++ b/cad/py-amaranth/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1690525544 +SHA256 (amaranth-lang-amaranth-v0.3-160-gb952005_GH0.tar.gz) = 8bdab7fbd10dc07d99a383316b2503dd00733b6dd99e787e0ffe4cb27f8eb112 +SIZE (amaranth-lang-amaranth-v0.3-160-gb952005_GH0.tar.gz) = 261933 diff --git a/cad/py-amaranth/files/patch-pyproject.toml b/cad/py-amaranth/files/patch-pyproject.toml new file mode 100644 index 000000000000..00ed445714f6 --- /dev/null +++ b/cad/py-amaranth/files/patch-pyproject.toml @@ -0,0 +1,37 @@ +--- pyproject.toml.orig 2023-07-27 13:04:20 UTC ++++ pyproject.toml +@@ -1,12 +1,13 @@ + # Project metadata + + [project] +-dynamic = ["version", "urls"] ++dynamic = ["urls"] + + name = "amaranth" + description = "Amaranth hardware definition language" + authors = [{name = "Amaranth HDL contributors"}] + license = {file = "LICENSE.txt"} ++version = "%%VERSION%%" + + requires-python = "~=3.8" + dependencies = [ +@@ -26,7 +27,7 @@ amaranth-rpc = "amaranth.rpc:main" + # Build system configuration + + [build-system] +-requires = ["wheel", "setuptools>=67.0", "setuptools_scm[toml]>=6.2"] ++requires = ["wheel", "setuptools>0", "setuptools_scm[toml]>=6.2"] + build-backend = "setuptools.build_meta" + + [tool.setuptools] +@@ -36,8 +37,8 @@ build-backend = "setuptools.build_meta" + # Add a workaround to improve experience for people upgrading from old checkouts. + packages = ["amaranth"] + +-[tool.setuptools_scm] +-local_scheme = "node-and-timestamp" ++#[tool.setuptools_scm] ++#local_scheme = "node-and-timestamp" + + # Development workflow configuration + diff --git a/cad/py-amaranth/pkg-descr b/cad/py-amaranth/pkg-descr new file mode 100644 index 000000000000..870e34a8dffc --- /dev/null +++ b/cad/py-amaranth/pkg-descr @@ -0,0 +1,12 @@ +The Amaranth project provides an open-source toolchain for developing hardware +based on synchronous digital logic using the Python programming language, as +well as evaluation board definitions, a System on Chip toolkit, and more. It +aims to be easy to learn and use, reduce or eliminate common coding mistakes, +and simplify the design of complex hardware with reusable components. + +The Amaranth toolchain consists of the Amaranth hardware definition language, +the standard library, the simulator, and the build system, covering all steps of +a typical FPGA development workflow. At the same time, it does not restrict the +designer's choice of tools: existing industry-standard (System)Verilog or VHDL +code can be integrated into an Amaranth-based design flow, or, conversely, +Amaranth code can be integrated into an existing Verilog-based design flow.