commit:     576b93e95cfec6043037dd12360011fd72204a42
Author:     Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Thu Oct 20 03:04:33 2022 +0000
Commit:     Rui Huang <vowstar <AT> gmail <DOT> com>
CommitDate: Thu Oct 20 03:04:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=576b93e9

sci-electronics/slang: new package, add 1.0, 9999

Signed-off-by: Huang Rui <vowstar <AT> gmail.com>

 sci-electronics/slang/Manifest          |  1 +
 sci-electronics/slang/metadata.xml      | 20 +++++++++++
 sci-electronics/slang/slang-1.0.ebuild  | 59 +++++++++++++++++++++++++++++++++
 sci-electronics/slang/slang-9999.ebuild | 59 +++++++++++++++++++++++++++++++++
 4 files changed, 139 insertions(+)

diff --git a/sci-electronics/slang/Manifest b/sci-electronics/slang/Manifest
new file mode 100644
index 000000000..db3d59054
--- /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 000000000..a2f50fb62
--- /dev/null
+++ b/sci-electronics/slang/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Huang Rui</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">MikePopoloski/slang</remote-id>
+       </upstream>
+       <longdescription lang="en">
+       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).
+       </longdescription>
+</pkgmetadata>

diff --git a/sci-electronics/slang/slang-1.0.ebuild 
b/sci-electronics/slang/slang-1.0.ebuild
new file mode 100644
index 000000000..1e1d7d743
--- /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 000000000..1e1d7d743
--- /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
+}

Reply via email to