sci-electronics/bluespec: add eselect support

Fix symbolic link problem

Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui 2022-08-29 04:28:00 +08:00
parent 8085408945
commit 5e60b24573
No known key found for this signature in database
GPG Key ID: AD4E34A8385E3E52
2 changed files with 33 additions and 2 deletions

View File

@ -59,6 +59,7 @@ BDEPEND="
dev-texlive/texlive-latexrecommended
dev-texlive/texlive-plaingeneric
)
sys-apps/coreutils
sys-devel/autoconf
sys-devel/bison
sys-devel/flex
@ -82,12 +83,10 @@ src_prepare() {
src_compile() {
# NO_DEPS_CHECKS=1: skip the subrepo check (this deriviation uses yices.src instead of the subrepo)
# NOGIT=1: https://github.com/B-Lang-org/bsc/issues/12
# LDCONFIG=ldconfig: https://github.com/B-Lang-org/bsc/pull/43
# STP_STUB=1: https://github.com/B-Lang-org/bsc/pull/278
emake \
"NO_DEPS_CHECKS=1" \
"NOGIT=1" \
"LDCONFIG=ldconfig" \
"STP_STUB=1" \
$(usex doc "" "NOASCIIDOCTOR=1") \
@ -119,6 +118,13 @@ src_install() {
local INSTALL_PATH=/usr/share/bsc/bsc-"${PV}"
local ED_INSTALL_PATH="${ED}${INSTALL_PATH}"
mkdir -p "${ED_INSTALL_PATH}" || die
local f
for f in "${S}"/inst/bin/*; do
if [[ ! -d "${f}" ]] ; then
local b=$(basename ${f})
sed -i "s|ABSNAME=.*\$|ABSNAME=\$(readlink -f -- \"\$0\")|g" "${f}" || die
fi
done
cp -dr --preserve=mode,timestamp "${S}"/inst/* "${ED_INSTALL_PATH}"/ || die
insinto "${INSTALL_PATH}"/vimfiles
doins -r "${S}"/util/vim/{ftdetect,indent,syntax}

View File

@ -25,6 +25,7 @@ IUSE="doc test"
RESTRICT="!test? ( test )"
RDEPEND="
app-eselect/eselect-bluespec
dev-haskell/old-time:0=
dev-haskell/regex-compat:0=
dev-haskell/split:0=
@ -58,6 +59,7 @@ BDEPEND="
dev-texlive/texlive-latexrecommended
dev-texlive/texlive-plaingeneric
)
sys-apps/coreutils
sys-devel/autoconf
sys-devel/bison
sys-devel/flex
@ -103,6 +105,14 @@ src_test() {
emake -C testsuite check
}
# Call eselect vi update with --if-unset
# to respect user's choice
eselect_bluespec_update() {
ebegin "Calling eselect bluespec update"
eselect bluespec update --if-unset
eend $?
}
src_install() {
# From https://github.com/B-Lang-org/bsc/blob/main/INSTALL.md,
# upstream recommend placing the inst directory at
@ -110,7 +120,22 @@ src_install() {
local INSTALL_PATH=/usr/share/bsc/bsc-"${PV}"
local ED_INSTALL_PATH="${ED}${INSTALL_PATH}"
mkdir -p "${ED_INSTALL_PATH}" || die
local f
for f in "${S}"/inst/bin/*; do
if [[ ! -d "${f}" ]] ; then
local b=$(basename ${f})
sed -i "s|ABSNAME=.*\$|ABSNAME=\$(readlink -f -- \"\$0\")|g" "${f}" || die
fi
done
cp -dr --preserve=mode,timestamp "${S}"/inst/* "${ED_INSTALL_PATH}"/ || die
insinto "${INSTALL_PATH}"/vimfiles
doins -r "${S}"/util/vim/{ftdetect,indent,syntax}
}
pkg_postinst() {
eselect_bluespec_update
}
pkg_postrm() {
eselect_bluespec_update
}