void-packages/srcpkgs/berkeley-abc/patches/remove_bzlib_convenience.patch
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: convert patches to -Np1
```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

62 lines
2 KiB
Diff

From: Ruben Undheim <ruben.undheim@gmail.com>
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
--- a/Makefile
+++ b/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
--- a/src/base/io/ioReadAiger.c
+++ b/src/base/io/ioReadAiger.c
@@ -26,7 +26,7 @@
#include <string.h>
#include <assert.h>
-#include "misc/bzlib/bzlib.h"
+#include <bzlib.h>
#include "misc/zlib/zlib.h"
#include "ioAbc.h"
diff --git src/base/io/ioWriteAiger.c src/base/io/ioWriteAiger.c
index 0a68c7e..f0744c6 100644
--- a/src/base/io/ioWriteAiger.c
+++ b/src/base/io/ioWriteAiger.c
@@ -26,7 +26,7 @@
#include <string.h>
#include <assert.h>
-#include "misc/bzlib/bzlib.h"
+#include <bzlib.h>
#include "misc/zlib/zlib.h"
#include "ioAbc.h"