fix wine stack

This commit is contained in:
Alexander Stefanov 2023-09-06 09:53:41 +00:00
parent 0147829931
commit ef2c071c97
3 changed files with 104 additions and 95 deletions

View file

@ -1,18 +0,0 @@
diff --git a/Makefile-libbz2_so b/Makefile-libbz2_so
index 9b281eb..bcfeb77 100644
--- a/Makefile-libbz2_so
+++ b/Makefile-libbz2_so
@@ -52,11 +52,13 @@ $(LIBRARY): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared $(top_sourcedir)/bzip2.c $(LIBRARY)
rm -f libbz2.so.1.0
ln -s $(LIBRARY) libbz2.so.1.0
+ ln -s $(LIBRARY) libbz2.so.1
install: all
mkdir -p $(DESTDIR)$(root_libdir)
install -m755 $(LIBRARY) $(DESTDIR)$(root_libdir)
ln -sf $(LIBRARY) $(DESTDIR)$(root_libdir)/libbz2.so.1.0
+ ln -sf $(LIBRARY) $(DESTDIR)$(root_libdir)/libbz2.so.1
mkdir -p $(DESTDIR)$(libdir)
rm -f $(DESTDIR)$(libdir)/libbz2.so
ln -sr $(DESTDIR)$(root_libdir)/$(LIBRARY) $(DESTDIR)$(libdir)/libbz2.so

View file

@ -1,69 +1,7 @@
--- bzip2-1.0.6/Makefile-libbz2_so.mdkconf~ 2012-12-14 11:05:55.017674909 +0100
+++ bzip2-1.0.6/Makefile-libbz2_so 2012-12-14 11:07:25.803497360 +0100
@@ -20,7 +20,13 @@
# in the file LICENSE.
# ------------------------------------------------------------------
-include config.in
+top_sourcedir = .
+include $(top_sourcedir)/config.in
+
+prefix = /usr
+root_libdir= /$(lib)
+libdir = $(prefix)/$(lib)
+
SHELL=/bin/sh
CC=gcc
@@ -36,26 +42,27 @@ OBJS= blocksort.o \
decompress.o \
bzlib.o
-all: $(OBJS)
- $(CC) $(CFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1.0 $(LDFLAGS) -o libbz2.so.1.0.8 $(OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
+LIBRARY = libbz2.so.1.0.8
+
+all: $(LIBRARY)
+
+
+$(LIBRARY): $(OBJS)
+ $(CC) $(CFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 $(LDFLAGS) -o $(LIBRARY) $(OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared $(top_sourcedir)/bzip2.c $(LIBRARY)
rm -f libbz2.so.1.0
- ln -s libbz2.so.1.0.8 libbz2.so.1.0
+ ln -s $(LIBRARY) libbz2.so.1.0
+
+install: all
+ mkdir -p $(DESTDIR)$(root_libdir)
+ install -m755 $(LIBRARY) $(DESTDIR)$(root_libdir)
+ ln -sf $(LIBRARY) $(DESTDIR)$(root_libdir)/libbz2.so.1.0
+ mkdir -p $(DESTDIR)$(libdir)
+ rm -f $(DESTDIR)$(libdir)/libbz2.so
+ ln -sr $(DESTDIR)$(root_libdir)/$(LIBRARY) $(DESTDIR)$(libdir)/libbz2.so
clean:
- rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared
+ rm -f $(OBJS) bzip2.o $(LIBRARY) libbz2.so.1.0 bzip2-shared
-blocksort.o: blocksort.c
- $(CC) $(CFLAGS) -c blocksort.c
-huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
-crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
-randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
-compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
-decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
-bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
+%.o: $(top_sourcedir)/%.c $(top_sourcedir)/bzlib.h $(top_sourcedir)/bzlib_private.h
+ $(CC) $(CFLAGS) -c $<
--- bzip2-1.0.6/Makefile.mdkconf~ 2012-12-14 11:05:55.017674909 +0100
+++ bzip2-1.0.6/Makefile 2012-12-14 11:05:55.021674769 +0100
diff --git a/Makefile b/Makefile
index f196637..d308984 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,8 @@
# in the file LICENSE.
# ------------------------------------------------------------------
@ -178,7 +116,7 @@
libtool --tag=CC --mode=compile $(CC) $(CFLAGS) -c $<
distclean: clean
@@ -187,10 +193,10 @@ MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz
@@ -187,10 +193,10 @@ MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \
manual: manual.html manual.ps manual.pdf
manual.ps: $(MANUAL_SRCS)
@ -192,3 +130,96 @@
manual.html: $(MANUAL_SRCS)
- ./xmlproc.sh -html manual.xml
+ $(top_sourcedir)/xmlproc.sh -html $(top_sourcedir)/manual.xml
diff --git a/Makefile-libbz2_so b/Makefile-libbz2_so
index e4f06b9..4c81c90 100644
--- a/Makefile-libbz2_so
+++ b/Makefile-libbz2_so
@@ -1,9 +1,9 @@
-# This Makefile builds a shared version of the library,
+# This Makefile builds a shared version of the library,
# libbz2.so.1.0.8, with soname libbz2.so.1.0,
-# at least on x86-Linux (RedHat 7.2),
-# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
-# Please see the README file for some important info
+# at least on x86-Linux (RedHat 7.2),
+# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
+# Please see the README file for some important info
# about building the library like this.
# ------------------------------------------------------------------
@@ -13,14 +13,20 @@
# bzip2/libbzip2 version 1.0.8 of 13 July 2019
# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
#
-# Please read the WARNING, DISCLAIMER and PATENTS sections in the
+# Please read the WARNING, DISCLAIMER and PATENTS sections in the
# README file.
#
# This program is released under the terms of the license contained
# in the file LICENSE.
# ------------------------------------------------------------------
-include config.in
+top_sourcedir = .
+include $(top_sourcedir)/config.in
+
+prefix = /usr
+root_libdir= /$(lib)
+libdir = $(lib)
+
SHELL=/bin/sh
CC=gcc
@@ -36,26 +42,29 @@ OBJS= blocksort.o \
decompress.o \
bzlib.o
-all: $(OBJS)
- $(CC) $(CFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1.0 $(LDFLAGS) -o libbz2.so.1.0.8 $(OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
+LIBRARY = libbz2.so.1.0.8
+
+all: $(LIBRARY)
+
+
+$(LIBRARY): $(OBJS)
+ $(CC) $(CFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 $(LDFLAGS) -o $(LIBRARY) $(OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared $(top_sourcedir)/bzip2.c $(LIBRARY)
rm -f libbz2.so.1.0
- ln -s libbz2.so.1.0.8 libbz2.so.1.0
-
-clean:
- rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared
-
-blocksort.o: blocksort.c
- $(CC) $(CFLAGS) -c blocksort.c
-huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
-crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
-randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
-compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
-decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
-bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
+ ln -s $(LIBRARY) libbz2.so.1.0
+ ln -s $(LIBRARY) libbz2.so.1
+
+install: all
+ mkdir -p $(DESTDIR)$(root_libdir)
+ install -m755 $(LIBRARY) $(DESTDIR)$(root_libdir)
+ ln -sf $(LIBRARY) $(DESTDIR)$(root_libdir)/libbz2.so.1.0
+ ln -sf $(LIBRARY) $(DESTDIR)$(root_libdir)/libbz2.so.1
+ mkdir -p $(DESTDIR)$(libdir)
+ rm -f $(DESTDIR)$(libdir)/libbz2.so
+ ln -sr $(DESTDIR)$(root_libdir)/$(LIBRARY) $(DESTDIR)$(libdir)/libbz2.so
+
+clean:
+ rm -f $(OBJS) bzip2.o $(LIBRARY) libbz2.so.1.0 bzip2-shared
+
+%.o: $(top_sourcedir)/%.c $(top_sourcedir)/bzlib.h $(top_sourcedir)/bzlib_private.h
+ $(CC) $(CFLAGS) -c $<

View file

@ -18,7 +18,6 @@ Source3: bzme.1
Source4: bzip2.pc
Patch0: bzip2-1.0.6-makefile.diff
Patch1: bzip2-1.0.6-improve-makefile.patch
Patch2: build_good-so-lib.patch
# (tpg) ClearLinux Patches
Patch10: https://raw.githubusercontent.com/clearlinux-pkgs/bzip2/master/0001-Improve-file-access.patch
BuildRequires: libtool
@ -57,8 +56,8 @@ bzip2 library (aka libz2).
%files -n %{libname}
%doc LICENSE
/%{_lib}/libbz2.so.%{major}
/%{_lib}/libbz2.so.%{major}.*
%{_libdir}/libbz2.so.%{major}
%{_libdir}/libbz2.so.%{major}.*
#----------------------------------------------------------------------------
@ -86,10 +85,8 @@ will use the bzip2 library (aka libz2).
#----------------------------------------------------------------------------
%prep
%setup -q
%apply_patches
echo "lib = %{_lib}" >> config.in
%autosetup -p1
echo "lib = %{_libdir}" >> config.in
echo "CFLAGS = %{optflags}" >> config.in
echo "LDFLAGS = %{ldflags}" >> config.in
@ -101,8 +98,7 @@ sed -i "s|^libdir=|libdir=%{_libdir}|" bzip2.pc
sed -i "s|@VERSION@|%{version}|" bzip2.pc
%build
%make -f Makefile-libbz2_so
%make
%make_build -f Makefile-libbz2_so all
%if %{with pdf}
texi2dvi --pdf manual.texi
@ -129,7 +125,7 @@ chmod 755 %{buildroot}%{_bindir}/bzless
# https://stackoverflow.com/a/10586169
# bashisms :(
IFS='.' read -r -a array <<< %{version}
buildroot_lib="%{buildroot}/%{_lib}"
buildroot_lib="%{buildroot}/%{_libdir}"
cur_name="libbz2.so" #cur_name - current name
for index in "${!array[@]}"
do