mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 20:13:01 -04:00
sci-electronics/slang: fix bugs and bump to 2.0
Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
@@ -1 +1,2 @@
|
||||
DIST slang-1.0.tar.gz 1239664 BLAKE2B 98355987b5c355eb914dd0d38c7441d5d39b7a0259e557d9cfd6271fd35aab642db6036d55228f75522fef0c31a4c82dea4d09cdb04ea33c60d843a3ca14caf0 SHA512 25ef7f5abb1b73928f61b853db5462baf72077a47daa9419311aba1f8fdca0bd499518c2f64dfff95b3c0671e52f2b1cd37edb7d1c74fb983b74de08fe7eea37
|
||||
DIST slang-2.0.tar.gz 1026299 BLAKE2B d55e0f419e030a37ff80aef3c0b16a96ee402707c758797fea3d1914e29247d22d240693cd873f95f634438fad5b8ed65961a324c69788fc3e62f83ce0a94869 SHA512 3d18961cda7eb40877932e937364b19cfcef3127a8467fbfc70febd1d6ef8b267aeae8244355a4b0206197ef126ee5a65aa4a4fb49d0970fe6c626725b7e6b21
|
||||
|
||||
64
sci-electronics/slang/files/slang-2.0-fix-lib-path.patch
Normal file
64
sci-electronics/slang/files/slang-2.0-fix-lib-path.patch
Normal file
@@ -0,0 +1,64 @@
|
||||
From 16ef772ec581e929197eae35ef99993e4d7c8dbb Mon Sep 17 00:00:00 2001
|
||||
From: Huang Rui <vowstar@gmail.com>
|
||||
Date: Thu, 3 Nov 2022 12:04:42 +0800
|
||||
Subject: [PATCH] external/CMakeLists.txt: fix find_pkg when unordered_dense
|
||||
installed
|
||||
|
||||
If the user has already installed unordered_dense beforehand,
|
||||
avoid downloading and installing again.
|
||||
Applicable when the distribution has packaged unordered_dense.
|
||||
|
||||
Signed-off-by: Huang Rui <vowstar@gmail.com>
|
||||
---
|
||||
external/CMakeLists.txt | 22 ++++++++++++++++------
|
||||
1 file changed, 16 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
|
||||
index 97e0e79c7..6eb30989a 100644
|
||||
--- a/external/CMakeLists.txt
|
||||
+++ b/external/CMakeLists.txt
|
||||
@@ -27,11 +27,17 @@ if((SLANG_INCLUDE_PYLIB OR BUILD_SHARED_LIBS) AND NOT fmt_FOUND)
|
||||
set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
+set(find_pkg_args "")
|
||||
+if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
|
||||
+ set(find_pkg_args "FIND_PACKAGE_ARGS" "2.0.0")
|
||||
+endif()
|
||||
+
|
||||
FetchContent_Declare(
|
||||
unordered_dense
|
||||
GIT_REPOSITORY https://github.com/martinus/unordered_dense.git
|
||||
GIT_TAG v2.0.0
|
||||
- GIT_SHALLOW ON)
|
||||
+ GIT_SHALLOW ON
|
||||
+ ${find_pkg_args})
|
||||
FetchContent_MakeAvailable(unordered_dense)
|
||||
|
||||
if(SLANG_INCLUDE_INSTALL)
|
||||
@@ -44,10 +50,12 @@ if(SLANG_INCLUDE_INSTALL)
|
||||
${PROJECT_SOURCE_DIR}/external/span.hpp
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
COMPONENT slang_Development)
|
||||
- install(
|
||||
- DIRECTORY ${unordered_dense_SOURCE_DIR}/include/ankerl
|
||||
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
- COMPONENT slang_Development)
|
||||
+ if(NOT unordered_dense_FOUND)
|
||||
+ install(
|
||||
+ DIRECTORY ${unordered_dense_SOURCE_DIR}/include/ankerl
|
||||
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
+ COMPONENT slang_Development)
|
||||
+ endif()
|
||||
|
||||
if(NOT fmt_FOUND)
|
||||
install(
|
||||
@@ -59,5 +67,7 @@ if(SLANG_INCLUDE_INSTALL)
|
||||
PRIVATE_HEADER EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
- install(TARGETS unordered_dense EXPORT slangTargets)
|
||||
+ if(NOT unordered_dense_FOUND)
|
||||
+ install(TARGETS unordered_dense EXPORT slangTargets)
|
||||
+ endif()
|
||||
endif()
|
||||
@@ -4,7 +4,7 @@
|
||||
EAPI="8"
|
||||
|
||||
PYTHON_COMPAT=( python3_{8..11} )
|
||||
inherit cmake python-r1
|
||||
inherit cmake python-single-r1
|
||||
|
||||
DESCRIPTION="SystemVerilog compiler and language services"
|
||||
HOMEPAGE="
|
||||
@@ -42,7 +42,6 @@ src_configure() {
|
||||
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
|
||||
|
||||
67
sci-electronics/slang/slang-2.0.ebuild
Normal file
67
sci-electronics/slang/slang-2.0.ebuild
Normal file
@@ -0,0 +1,67 @@
|
||||
# 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-single-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-cpp/catch-3.0.1
|
||||
>=dev-libs/libfmt-9.1.0
|
||||
>=dev-libs/unordered_dense-2.0.0
|
||||
$(python_gen_cond_dep '
|
||||
>=dev-python/pybind11-2.10[${PYTHON_USEDEP}]
|
||||
')
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-2.0-fix-lib-path.patch"
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
python_setup
|
||||
# BUILD_SHARED_LIBS=OFF because of name collision
|
||||
# https://github.com/MikePopoloski/slang/issues/646
|
||||
local mycmakeargs=(
|
||||
-D CMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)"
|
||||
-D BUILD_SHARED_LIBS=OFF
|
||||
-D SLANG_INCLUDE_PYLIB=$(usex python)
|
||||
-D SLANG_INCLUDE_TESTS=$(usex test)
|
||||
)
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
|
||||
# fix python unexpected paths QA
|
||||
mkdir -p "${D}/$(python_get_sitedir)" || die
|
||||
mv "${D}"/usr/pyslang* "${D}/$(python_get_sitedir)" || die
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
EAPI="8"
|
||||
|
||||
PYTHON_COMPAT=( python3_{8..11} )
|
||||
inherit cmake python-r1
|
||||
inherit cmake python-single-r1
|
||||
|
||||
DESCRIPTION="SystemVerilog compiler and language services"
|
||||
HOMEPAGE="
|
||||
@@ -29,19 +29,29 @@ RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
dev-libs/libfmt
|
||||
>=dev-cpp/catch-3.0.1
|
||||
>=dev-libs/libfmt-9.1.0
|
||||
>=dev-libs/unordered_dense-2.0.0
|
||||
$(python_gen_cond_dep '
|
||||
>=dev-python/pybind11-2.10[${PYTHON_USEDEP}]
|
||||
')
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-2.0-fix-lib-path.patch"
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
python_setup
|
||||
|
||||
# BUILD_SHARED_LIBS=OFF because of name collision
|
||||
# https://github.com/MikePopoloski/slang/issues/646
|
||||
local mycmakeargs=(
|
||||
-D CMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)"
|
||||
-D BUILD_SHARED_LIBS=ON
|
||||
-D BUILD_SHARED_LIBS=OFF
|
||||
-D SLANG_INCLUDE_PYLIB=$(usex python)
|
||||
-D SLANG_INCLUDE_TESTS=$(usex test)
|
||||
)
|
||||
@@ -50,10 +60,8 @@ 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
|
||||
|
||||
# fix python unexpected paths QA
|
||||
mkdir -p "${D}/$(python_get_sitedir)" || die
|
||||
mv "${D}"/usr/pyslang* "${D}/$(python_get_sitedir)" || die
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user