diff --git a/sci-electronics/slang/Manifest b/sci-electronics/slang/Manifest new file mode 100644 index 0000000000..db3d590541 --- /dev/null +++ b/sci-electronics/slang/Manifest @@ -0,0 +1 @@ +DIST slang-1.0.tar.gz 1239664 BLAKE2B 98355987b5c355eb914dd0d38c7441d5d39b7a0259e557d9cfd6271fd35aab642db6036d55228f75522fef0c31a4c82dea4d09cdb04ea33c60d843a3ca14caf0 SHA512 25ef7f5abb1b73928f61b853db5462baf72077a47daa9419311aba1f8fdca0bd499518c2f64dfff95b3c0671e52f2b1cd37edb7d1c74fb983b74de08fe7eea37 diff --git a/sci-electronics/slang/metadata.xml b/sci-electronics/slang/metadata.xml new file mode 100644 index 0000000000..a2f50fb62f --- /dev/null +++ b/sci-electronics/slang/metadata.xml @@ -0,0 +1,20 @@ + + + + + vowstar@gmail.com + Huang Rui + + + MikePopoloski/slang + + + slang is a software library that provides various components for lexing, + parsing, type checking, and elaborating SystemVerilog code. It comes with + an executable tool that can compile and lint any SystemVerilog project, + but it is also intended to be usable as a front end for synthesis tools, + simulators, linters, code editors, and refactoring tools. + slang is the fastest and most compliant SystemVerilog frontend + (according to the open source chipsalliance test suite). + + diff --git a/sci-electronics/slang/slang-1.0.ebuild b/sci-electronics/slang/slang-1.0.ebuild new file mode 100644 index 0000000000..1e1d7d743d --- /dev/null +++ b/sci-electronics/slang/slang-1.0.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake python-r1 + +DESCRIPTION="SystemVerilog compiler and language services" +HOMEPAGE=" + https://sv-lang.com + https://github.com/MikePopoloski/slang +" + +if [[ "${PV}" == "9999" ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/MikePopoloski/${PN}.git" +else + SRC_URI="https://github.com/MikePopoloski/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm64 ~riscv ~x86" + S="${WORKDIR}/${P}" +fi + +LICENSE="MIT" +SLOT="0" +IUSE="python test" +REQUIRED_USE=" ${PYTHON_REQUIRED_USE} " +RESTRICT="!test? ( test )" + +RDEPEND=" + ${PYTHON_DEPS} + dev-libs/libfmt +" + +DEPEND=" + ${RDEPEND} +" + +src_configure() { + python_setup + + local mycmakeargs=( + -D CMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)" + -D BUILD_SHARED_LIBS=ON + -D SLANG_INCLUDE_PYLIB=$(usex python) + -D SLANG_INCLUDE_TESTS=$(usex test) + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + # fix libdir path + if [[ "$(get_libdir)" != "lib" ]] ; then + mv "${D}"/usr/lib "${D}"/usr/"$(get_libdir)" || die + fi + # file collisions of internal fmt + rm -r "${D}"/usr/include/fmt || die +} diff --git a/sci-electronics/slang/slang-9999.ebuild b/sci-electronics/slang/slang-9999.ebuild new file mode 100644 index 0000000000..1e1d7d743d --- /dev/null +++ b/sci-electronics/slang/slang-9999.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake python-r1 + +DESCRIPTION="SystemVerilog compiler and language services" +HOMEPAGE=" + https://sv-lang.com + https://github.com/MikePopoloski/slang +" + +if [[ "${PV}" == "9999" ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/MikePopoloski/${PN}.git" +else + SRC_URI="https://github.com/MikePopoloski/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm64 ~riscv ~x86" + S="${WORKDIR}/${P}" +fi + +LICENSE="MIT" +SLOT="0" +IUSE="python test" +REQUIRED_USE=" ${PYTHON_REQUIRED_USE} " +RESTRICT="!test? ( test )" + +RDEPEND=" + ${PYTHON_DEPS} + dev-libs/libfmt +" + +DEPEND=" + ${RDEPEND} +" + +src_configure() { + python_setup + + local mycmakeargs=( + -D CMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)" + -D BUILD_SHARED_LIBS=ON + -D SLANG_INCLUDE_PYLIB=$(usex python) + -D SLANG_INCLUDE_TESTS=$(usex test) + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + # fix libdir path + if [[ "$(get_libdir)" != "lib" ]] ; then + mv "${D}"/usr/lib "${D}"/usr/"$(get_libdir)" || die + fi + # file collisions of internal fmt + rm -r "${D}"/usr/include/fmt || die +}