mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-21 21:13:27 -04:00
sci-electronics/yosys: call python_setup for valid PYTHON_EXECUTABLE
- llvm-r2 pkg_setup shadowed python-any-r1 so PYTHON was empty in all phases - call python_setup in pkg_setup and drop the src_prepare shebang/chmod loop - python_fix_shebang the installed yosys-smtbmc and yosys-witness wrappers Closes: https://bugs.gentoo.org/976328 Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
@@ -38,19 +38,13 @@ BDEPEND="
|
|||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
"
|
"
|
||||||
|
|
||||||
src_prepare() {
|
pkg_setup() {
|
||||||
default
|
# llvm-r2 and python-any-r1 both export pkg_setup and llvm-r2 wins,
|
||||||
|
# leaving PYTHON unset, so call python_setup ourselves. An empty
|
||||||
# Fix execute permissions and add shebang for Python scripts
|
# PYTHON_EXECUTABLE makes the Makefile run helper scripts via their env
|
||||||
local script
|
# python3 shebang, which breaks with python-exec[-native-symlinks].
|
||||||
while IFS= read -r -d '' script; do
|
llvm-r2_pkg_setup
|
||||||
chmod +x "${script}" || die
|
python_setup
|
||||||
# Add shebang if missing
|
|
||||||
if ! head -n 1 "${script}" | grep -q '^#!'; then
|
|
||||||
sed -i '1i#!/usr/bin/env python3' "${script}" || die
|
|
||||||
fi
|
|
||||||
done < <(find . -name "*.py" -print0)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
@@ -64,3 +58,11 @@ src_configure() {
|
|||||||
|
|
||||||
default
|
default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
default
|
||||||
|
|
||||||
|
# yosys-smtbmc and yosys-witness keep an env python3 shebang that also
|
||||||
|
# breaks under python-exec[-native-symlinks]; retarget them at EPYTHON.
|
||||||
|
python_fix_shebang "${ED}"/usr/bin/yosys-smtbmc "${ED}"/usr/bin/yosys-witness
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user