From cf471aa034dcff1b602903d40a637d82dd6ff511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 25 Dec 2020 23:52:44 +0700 Subject: [PATCH 1/2] New package: berkeley-abc-1.01+20201124 --- .../patches/remove_bzlib_convenience.patch | 62 +++++++++++++++ .../patches/remove_zlib_convenience.patch | 75 +++++++++++++++++++ .../patches/reproducibility.patch | 37 +++++++++ srcpkgs/berkeley-abc/template | 38 ++++++++++ 4 files changed, 212 insertions(+) create mode 100644 srcpkgs/berkeley-abc/patches/remove_bzlib_convenience.patch create mode 100644 srcpkgs/berkeley-abc/patches/remove_zlib_convenience.patch create mode 100644 srcpkgs/berkeley-abc/patches/reproducibility.patch create mode 100644 srcpkgs/berkeley-abc/template diff --git a/srcpkgs/berkeley-abc/patches/remove_bzlib_convenience.patch b/srcpkgs/berkeley-abc/patches/remove_bzlib_convenience.patch new file mode 100644 index 00000000000..00bf278ce70 --- /dev/null +++ b/srcpkgs/berkeley-abc/patches/remove_bzlib_convenience.patch @@ -0,0 +1,62 @@ +From: Ruben Undheim +Date: Sat, 4 Aug 2018 13:17:43 +0000 +Subject: The library bzlib is included in the source and + + built as a convenience library. This patch prevents this from being + built and links berkeley-abc with debian's bzlib library instead. +Forwarded: doesn't make sense upstream +=================================================================== +--- + Makefile | 4 +++- + src/base/io/ioReadAiger.c | 2 +- + src/base/io/ioWriteAiger.c | 2 +- + 3 files changed, 5 insertions(+), 3 deletions(-) + +diff --git Makefile Makefile +index e0e8b8f..36b0f89 100644 +--- Makefile ++++ Makefile +@@ -20,7 +20,7 @@ MODULES := \ + src/map/mapper src/map/mio src/map/super src/map/if \ + src/map/amap src/map/cov src/map/scl src/map/mpm \ + src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/nm \ +- src/misc/vec src/misc/hash src/misc/tim src/misc/bzlib src/misc/zlib \ ++ src/misc/vec src/misc/hash src/misc/tim src/misc/zlib \ + src/misc/mem src/misc/bar src/misc/bbl src/misc/parse \ + src/opt/cut src/opt/fxu src/opt/fxch src/opt/rwr src/opt/mfs src/opt/sim \ + src/opt/ret src/opt/fret src/opt/res src/opt/lpk src/opt/nwk src/opt/rwt \ +@@ -143,6 +143,8 @@ ifneq ($(findstring Darwin, $(shell uname)), Darwin) + LIBS += -lrt + endif + ++LIBS += -lbz2 ++ + ifdef ABC_USE_LIBSTDCXX + LIBS += -lstdc++ + $(info $(MSG_PREFIX)Using explicit -lstdc++) +diff --git src/base/io/ioReadAiger.c src/base/io/ioReadAiger.c +index f87d971..4f0f6a3 100644 +--- src/base/io/ioReadAiger.c ++++ src/base/io/ioReadAiger.c +@@ -26,7 +26,7 @@ + #include + #include + +-#include "misc/bzlib/bzlib.h" ++#include + #include "misc/zlib/zlib.h" + #include "ioAbc.h" + +diff --git src/base/io/ioWriteAiger.c src/base/io/ioWriteAiger.c +index 0a68c7e..f0744c6 100644 +--- src/base/io/ioWriteAiger.c ++++ src/base/io/ioWriteAiger.c +@@ -26,7 +26,7 @@ + #include + #include + +-#include "misc/bzlib/bzlib.h" ++#include + #include "misc/zlib/zlib.h" + #include "ioAbc.h" + diff --git a/srcpkgs/berkeley-abc/patches/remove_zlib_convenience.patch b/srcpkgs/berkeley-abc/patches/remove_zlib_convenience.patch new file mode 100644 index 00000000000..d869703569f --- /dev/null +++ b/srcpkgs/berkeley-abc/patches/remove_zlib_convenience.patch @@ -0,0 +1,75 @@ +From: Ruben Undheim +Date: Sat, 4 Aug 2018 13:17:43 +0000 +Subject: The library zlib is included in the source and + + built as a convenience library. This patch prevents this from being + built and links berkeley-abc with debian's zlib library instead. +Forwarded: doesn't make sense upstream +=================================================================== +--- + Makefile | 3 ++- + src/base/io/ioReadAiger.c | 2 +- + src/base/io/ioWriteAiger.c | 2 +- + src/sat/cnf/cnfMan.c | 2 +- + 4 files changed, 5 insertions(+), 4 deletions(-) + +diff --git Makefile Makefile +index 36b0f89..68651d2 100644 +--- Makefile ++++ Makefile +@@ -20,7 +20,7 @@ MODULES := \ + src/map/mapper src/map/mio src/map/super src/map/if \ + src/map/amap src/map/cov src/map/scl src/map/mpm \ + src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/nm \ +- src/misc/vec src/misc/hash src/misc/tim src/misc/zlib \ ++ src/misc/vec src/misc/hash src/misc/tim \ + src/misc/mem src/misc/bar src/misc/bbl src/misc/parse \ + src/opt/cut src/opt/fxu src/opt/fxch src/opt/rwr src/opt/mfs src/opt/sim \ + src/opt/ret src/opt/fret src/opt/res src/opt/lpk src/opt/nwk src/opt/rwt \ +@@ -144,6 +144,7 @@ ifneq ($(findstring Darwin, $(shell uname)), Darwin) + endif + + LIBS += -lbz2 ++LIBS += -lz + + ifdef ABC_USE_LIBSTDCXX + LIBS += -lstdc++ +diff --git src/base/io/ioReadAiger.c src/base/io/ioReadAiger.c +index 4f0f6a3..e174ff6 100644 +--- src/base/io/ioReadAiger.c ++++ src/base/io/ioReadAiger.c +@@ -27,7 +27,7 @@ + #include + + #include +-#include "misc/zlib/zlib.h" ++#include + #include "ioAbc.h" + + ABC_NAMESPACE_IMPL_START +diff --git src/base/io/ioWriteAiger.c src/base/io/ioWriteAiger.c +index f0744c6..d265104 100644 +--- src/base/io/ioWriteAiger.c ++++ src/base/io/ioWriteAiger.c +@@ -27,7 +27,7 @@ + #include + + #include +-#include "misc/zlib/zlib.h" ++#include + #include "ioAbc.h" + + +diff --git src/sat/cnf/cnfMan.c src/sat/cnf/cnfMan.c +index 5a125ec..54c582f 100644 +--- src/sat/cnf/cnfMan.c ++++ src/sat/cnf/cnfMan.c +@@ -21,7 +21,7 @@ + #include "cnf.h" + #include "sat/bsat/satSolver.h" + #include "sat/bsat/satSolver2.h" +-#include "misc/zlib/zlib.h" ++#include + + ABC_NAMESPACE_IMPL_START + diff --git a/srcpkgs/berkeley-abc/patches/reproducibility.patch b/srcpkgs/berkeley-abc/patches/reproducibility.patch new file mode 100644 index 00000000000..c807519fa42 --- /dev/null +++ b/srcpkgs/berkeley-abc/patches/reproducibility.patch @@ -0,0 +1,37 @@ +From: Johann Klammer +Date: Sat, 4 Aug 2018 13:17:43 +0000 +Subject: Remove the __TIME__ etc macros + +Otherwise the debian package checking complains... +=================================================================== +--- + src/base/cmd/cmdUtils.c | 2 +- + src/base/main/mainUtils.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git src/base/cmd/cmdUtils.c src/base/cmd/cmdUtils.c +index 3409543..9b7223f 100644 +--- src/base/cmd/cmdUtils.c ++++ src/base/cmd/cmdUtils.c +@@ -589,7 +589,7 @@ void CmdCommandPrint( Abc_Frame_t * pAbc, int fPrintAll, int fDetails ) + nColumns = 79 / (LenghtMax + 2); + + // print the starting message +- fprintf( pAbc->Out, " Welcome to ABC compiled on %s %s!", __DATE__, __TIME__ ); ++ fprintf( pAbc->Out, " Welcome to ABC!"); + + // print the command by group + sGroupCur = NULL; +diff --git src/base/main/mainUtils.c src/base/main/mainUtils.c +index d1fe1d2..3668f3b 100644 +--- src/base/main/mainUtils.c ++++ src/base/main/mainUtils.c +@@ -52,7 +52,7 @@ static char * DateReadFromDateString( char * datestr ); + char * Abc_UtilsGetVersion( Abc_Frame_t * pAbc ) + { + static char Version[1000]; +- sprintf(Version, "%s (compiled %s %s)", ABC_VERSION, __DATE__, __TIME__); ++ sprintf(Version, "%s", ABC_VERSION); + return Version; + } + diff --git a/srcpkgs/berkeley-abc/template b/srcpkgs/berkeley-abc/template new file mode 100644 index 00000000000..f5aeb2a1e4f --- /dev/null +++ b/srcpkgs/berkeley-abc/template @@ -0,0 +1,38 @@ +# Template file for 'berkeley-abc' +pkgname=berkeley-abc +# This is the version shipped by Fedora 34 +_gitrev=d4fb192575cd319de68764eac5b7e049f575f43e +version=1.01+20201124 +revision=1 +wrksrc=abc-$_gitrev +build_style=gnu-makefile +make_use_env=yes +make_build_args="ABC_MAKE_VERBOSE=1 ABC_USE_STDINT_H=1" +makedepends="readline-devel zlib-devel bzip2-devel" +short_desc="System for Sequential Synthesis and Verification" +maintainer="Đoàn Trần Công Danh " +license="custom:University-of-California, BSD-4-Clause, MIT, BSD-2-Clause" +homepage="http://www.eecs.berkeley.edu/~alanmi/abc/" +distfiles="https://github.com/berkeley-abc/abc/archive/$_gitrev.tar.gz" +checksum=52f1e9bf62c1e0d3b3cbe145f61b409a725e73fe606ba010efcbb2701a14171b + +post_patch() { + vsed -i -e '/^CC *:=/d' -e '/^CXX *:=/d' -e '/^AR *:=/d' \ + Makefile +} + +do_install() { + vbin abc + vlicense copyright.txt + vlicense src/bdd/cudd/license cudd.license + vlicense src/sat/bsat/license bsat.license + vlicense src/sat/bsat2/LICENSE bsat2.license + vlicense src/sat/glucose/license glucose.license + vlicense src/sat/glucose2/license glucose2.license + sed -n '/Copyright/,/THE SOFTWARE/p' src/sat/lsat/solver.h >lsat.license + vlicense lsat.license + vlicense src/sat/satoko/LICENSE satoko.license + vlicense src/sat/xsat/license xsat.license + sed -n '/Copyright/,/SUCH DAMAGE/p' src/sat/bsat2/pstdint.h >pstdint.license + vlicense pstdint.license +} From 18eae86350a917ce3a327684fc129b71628f1c6d Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Tue, 22 Dec 2020 11:36:31 +0000 Subject: [PATCH 2/2] 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 | 28 +++++++++++++++---- 2 files changed, 43 insertions(+), 6 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..14a9e5dd586 100644 --- a/srcpkgs/yosys/template +++ b/srcpkgs/yosys/template @@ -1,13 +1,15 @@ # 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" @@ -15,7 +17,21 @@ 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 }