diff --git a/cad/Makefile b/cad/Makefile index 33ad61a3cdd6..bdb5c4d15857 100644 --- a/cad/Makefile +++ b/cad/Makefile @@ -1,160 +1,161 @@ COMMENT = CAD tools SUBDIR += PrusaSlicer SUBDIR += abc SUBDIR += admesh SUBDIR += adms SUBDIR += alliance SUBDIR += antimony SUBDIR += appcsxcad SUBDIR += archimedes SUBDIR += astk-client SUBDIR += astk-serveur SUBDIR += atlc SUBDIR += brlcad SUBDIR += calculix SUBDIR += calculix-ccx SUBDIR += camotics SUBDIR += caneda SUBDIR += cascade SUBDIR += cascade-compiler SUBDIR += chipvault SUBDIR += csxcad SUBDIR += cura SUBDIR += cura-engine SUBDIR += cvc SUBDIR += digital SUBDIR += dinotrace SUBDIR += ecpprog SUBDIR += electric SUBDIR += electric-ng SUBDIR += fasm SUBDIR += fdm_materials SUBDIR += feappv SUBDIR += fidocadj SUBDIR += freecad SUBDIR += freehdl SUBDIR += fritzing SUBDIR += gds3d SUBDIR += gdscpp SUBDIR += gdsreader SUBDIR += gdt SUBDIR += geda SUBDIR += gerbv SUBDIR += ghdl SUBDIR += gmsh SUBDIR += gnucap SUBDIR += gplcver SUBDIR += graywolf SUBDIR += gspiceui SUBDIR += gtkwave SUBDIR += horizon-eda SUBDIR += hs-verismith SUBDIR += ifcopenshell SUBDIR += impact SUBDIR += irsim SUBDIR += iverilog SUBDIR += jspice3 SUBDIR += k40-whisperer SUBDIR += kicad SUBDIR += kicad-devel SUBDIR += kicad-doc SUBDIR += kicad-library-footprints SUBDIR += kicad-library-footprints-devel SUBDIR += kicad-library-packages3d SUBDIR += kicad-library-packages3d-devel SUBDIR += kicad-library-symbols SUBDIR += kicad-library-symbols-devel SUBDIR += kicad-library-templates SUBDIR += kicad-library-templates-devel SUBDIR += klayout SUBDIR += ktechlab SUBDIR += ldraw SUBDIR += ldview SUBDIR += leocad SUBDIR += lepton-eda SUBDIR += libgdsii SUBDIR += libopencad SUBDIR += librecad SUBDIR += libredwg SUBDIR += librepcb SUBDIR += librnd SUBDIR += logisim SUBDIR += magic SUBDIR += meshdev SUBDIR += meshlab SUBDIR += netgen SUBDIR += netgen-lvs SUBDIR += ngspice_rework SUBDIR += nvc SUBDIR += opencascade SUBDIR += opencascade740 SUBDIR += openctm SUBDIR += openfpgaloader SUBDIR += openroad SUBDIR += openscad SUBDIR += openscad-devel SUBDIR += opentimer SUBDIR += openvsp SUBDIR += oregano SUBDIR += p5-GDS2 SUBDIR += p5-Verilog-Perl SUBDIR += padring SUBDIR += pcb SUBDIR += pcb-rnd SUBDIR += pdnmesh + SUBDIR += py-amaranth SUBDIR += py-cadquery SUBDIR += py-cocotb SUBDIR += py-cq-editor SUBDIR += py-edalize SUBDIR += py-ezdxf SUBDIR += py-gdspy SUBDIR += py-gmsh SUBDIR += py-lcapy SUBDIR += py-ocp SUBDIR += py-phidl SUBDIR += py-pyfda SUBDIR += py-pygmsh SUBDIR += py-pymtl SUBDIR += py-pyvcd SUBDIR += py-vunit-hdl SUBDIR += python-gdsii SUBDIR += qcad SUBDIR += qcsxcad SUBDIR += qelectrotech SUBDIR += qflow SUBDIR += qmls SUBDIR += qrouter SUBDIR += qspeakers SUBDIR += qucs-s SUBDIR += qucsator SUBDIR += repsnapper SUBDIR += rubygem-gdsii SUBDIR += scotch SUBDIR += silice SUBDIR += solvespace SUBDIR += sp2sp SUBDIR += spice SUBDIR += stepcode SUBDIR += stm32flash SUBDIR += sumo SUBDIR += surelog SUBDIR += svlint SUBDIR += svls SUBDIR += sweethome3d SUBDIR += tkgate SUBDIR += tochnog SUBDIR += uhdm SUBDIR += uranium SUBDIR += verilator SUBDIR += verilog-mode.el SUBDIR += veroroute SUBDIR += veryl SUBDIR += xcircuit SUBDIR += xyce SUBDIR += yosys SUBDIR += yosys-systemverilog SUBDIR += z88 SUBDIR += zcad .include 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.