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

Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui
2022-10-20 11:04:33 +08:00
parent 2e4bef7423
commit 576b93e95c
4 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST slang-1.0.tar.gz 1239664 BLAKE2B 98355987b5c355eb914dd0d38c7441d5d39b7a0259e557d9cfd6271fd35aab642db6036d55228f75522fef0c31a4c82dea4d09cdb04ea33c60d843a3ca14caf0 SHA512 25ef7f5abb1b73928f61b853db5462baf72077a47daa9419311aba1f8fdca0bd499518c2f64dfff95b3c0671e52f2b1cd37edb7d1c74fb983b74de08fe7eea37

View File

@@ -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>vowstar@gmail.com</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>

View File

@@ -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
}

View File

@@ -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
}