yosys: fix PREFIX, data path, use external abc

Reported-by: Tomasz Kramkowski <tk@the-tk.com>
Close: #27348
This commit is contained in:
Đoàn Trần Công Danh 2020-12-26 00:19:25 +07:00
parent c41b11b32d
commit 1acf222ef1
2 changed files with 49 additions and 7 deletions

View file

@ -0,0 +1,21 @@
From: Ruben Undheim <ruben.undheim@gmail.com>
Date: Fri, 27 Jul 2018 18:46:13 +0000
Subject: Fix adding of sys.path in yosys-smtbmc
---
backends/smt2/Makefile.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git backends/smt2/Makefile.inc backends/smt2/Makefile.inc
index 92941d4..2c0b7c6 100644
--- backends/smt2/Makefile.inc
+++ backends/smt2/Makefile.inc
@@ -22,7 +22,7 @@ else
TARGETS += yosys-smtbmc
yosys-smtbmc: backends/smt2/smtbmc.py
- $(P) sed 's|##yosys-sys-path##|sys.path += [os.path.dirname(os.path.realpath(__file__)) + p for p in ["/share/python3", "/../share/yosys/python3"]]|;' < $< > $@.new
+ $(P) sed 's|##yosys-sys-path##|sys.path += ["/usr/share/yosys"]|;' < $< > $@.new
$(Q) chmod +x $@.new
$(Q) mv $@.new $@
endif

View file

@ -1,21 +1,42 @@
# Template file for 'yosys'
pkgname=yosys
# Remember to correct _gitrev on updating
_gitrev=1979e0b
version=0.9
revision=2
revision=3
wrksrc=${pkgname}-${pkgname}-${version}
build_style=gnu-makefile
make_use_env=yes
hostmakedepends="python3 bison flex pkg-config clang git tcl readline"
hostmakedepends="python3 bison flex pkg-config tcl"
makedepends="tcl-devel readline-devel libffi-devel"
depends="graphviz xdot"
depends="graphviz xdot berkeley-abc"
short_desc="Verilog RTL Synthesis Suite"
maintainer="Jasper Chan <jasperchan515@gmail.com>"
license="GPL-3.0-or-later"
license="ISC, MIT"
homepage="http://www.clifford.at/yosys/about.html"
distfiles="https://github.com/cliffordwolf/yosys/archive/yosys-${version}.tar.gz"
checksum=f2e31371f9cf1b36cb4f57b23fd6eb849adc7d935dcf49f3c905aa5136382c2f
pre_build() {
vsed -e "s,CXX = gcc,CXX = ${CC}," -e "s,LD = gcc, LD = ${CC}," -i Makefile
make config-gcc
post_patch() {
vsed -i -e 's,-I[$](PREFIX)/include,,' \
-e '/CXX = gcc/d' \
-e '/LD = gcc/d' \
-e "s/^GIT_REV :=.*/GIT_REV := $_gitrev/" \
Makefile
}
do_configure() {
cat <<-EOF >Makefile.conf
ABCEXTERNAL := abc
CONFIG := gcc
LD := $CC
PREFIX := /usr
PRETTY := 0
TCL_INCLUDE := $XBPS_CROSS_BASE/usr/include
EOF
}
post_install() {
vlicense COPYING
vlicense libs/minisat/LICENSE
}