From 1acf222ef1fbae983d631f21fd0fe4302f6561d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 26 Dec 2020 00:19:25 +0700 Subject: [PATCH] yosys: fix PREFIX, data path, use external abc Reported-by: Tomasz Kramkowski Close: #27348 --- ...x-adding-of-sys.path-in-yosys-smtbmc.patch | 21 +++++++++++ srcpkgs/yosys/template | 35 +++++++++++++++---- 2 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/yosys/patches/debian_patches_0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch diff --git a/srcpkgs/yosys/patches/debian_patches_0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch b/srcpkgs/yosys/patches/debian_patches_0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch new file mode 100644 index 00000000000..667fd635a07 --- /dev/null +++ b/srcpkgs/yosys/patches/debian_patches_0010-Fix-adding-of-sys.path-in-yosys-smtbmc.patch @@ -0,0 +1,21 @@ +From: Ruben Undheim +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 diff --git a/srcpkgs/yosys/template b/srcpkgs/yosys/template index 8ab48e2c4d2..72e7da38f40 100644 --- a/srcpkgs/yosys/template +++ b/srcpkgs/yosys/template @@ -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 " -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 }