1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Update to bzip2-1.0.8.

This commit is contained in:
Jonas 'Sortie' Termansen 2022-06-19 22:37:43 +02:00
parent 347f637d13
commit 4bc22cc169
10 changed files with 62 additions and 54 deletions

View file

@ -1 +0,0 @@
chmod +x -- 'make.sortix'

View file

@ -1,40 +1,62 @@
diff -Paur --no-dereference -- bzip2.upstream/bzip2.c bzip2/bzip2.c
--- bzip2.upstream/bzip2.c
+++ bzip2/bzip2.c
@@ -72,7 +72,9 @@
# include <utime.h>
# include <unistd.h>
# include <sys/stat.h>
+#if !defined(__sortix__)
# include <sys/times.h>
+#endif
# define PATH_SEP '/'
# define MY_LSTAT lstat
diff -Paur --no-dereference -- bzip2.upstream/Makefile bzip2/Makefile
--- bzip2.upstream/Makefile
+++ bzip2/Makefile
@@ -25,6 +25,8 @@
@@ -15,16 +15,19 @@
SHELL=/bin/sh
# To assist in cross-compiling
-CC=gcc
-AR=ar
-RANLIB=ranlib
-LDFLAGS=
-
-BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
+CC?=gcc
+AR?=ar
+RANLIB?=ranlib
+LDFLAGS?=
+
+BIGFILES?=-D_FILE_OFFSET_BITS=64
+CFLAGS?=-O2 -g
+CFLAGS+=-Wall $(BIGFILES)
# Where you want it installed when you do 'make install'
PREFIX=/usr/local
+EXEC_PREFIX=$(PREFIX)
+DESTDIR=
-PREFIX=/usr/local
+PREFIX?=/usr/local
+EXEC_PREFIX?=$(PREFIX)
+DESTDIR?=
OBJS= blocksort.o \
@@ -35,7 +37,7 @@
@@ -35,10 +38,12 @@
decompress.o \
bzlib.o
-all: libbz2.a bzip2 bzip2recover test
+all: libbz2.a bzip2 bzip2recover
+all: bzip2 bzip2recover
+
+libbz2: libbz2.a
bzip2: libbz2.a bzip2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
@@ -70,43 +72,43 @@
-bzip2: libbz2.a bzip2.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+bzip2: bzip2.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -lbz2
bzip2recover: bzip2recover.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
@@ -69,44 +74,46 @@
cmp sample3.tst sample3.ref
@cat words3
+install-libbz2: libbz2
+ if ( test ! -d $(DESTDIR)$(EXEC_PREFIX)/lib ) ; then mkdir -p $(DESTDIR)$(EXEC_PREFIX)/lib ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/include ) ; then mkdir -p $(DESTDIR)$(PREFIX)/include ; fi
+ cp -f bzlib.h $(DESTDIR)$(PREFIX)/include
+ chmod a+r $(DESTDIR)$(PREFIX)/include/bzlib.h
+ cp -f libbz2.a $(DESTDIR)$(EXEC_PREFIX)/lib
+ chmod a+r $(DESTDIR)$(EXEC_PREFIX)/lib/libbz2.a
+
install: bzip2 bzip2recover
- if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
- if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
@ -74,10 +96,8 @@ diff -Paur --no-dereference -- bzip2.upstream/Makefile bzip2/Makefile
- echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
- echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+ if ( test ! -d $(DESTDIR)$(EXEC_PREFIX)/bin ) ; then mkdir -p $(DESTDIR)$(EXEC_PREFIX)/bin ; fi
+ if ( test ! -d $(DESTDIR)$(EXEC_PREFIX)/lib ) ; then mkdir -p $(DESTDIR)$(EXEC_PREFIX)/lib ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/share/man ) ; then mkdir -p $(DESTDIR)$(PREFIX)/share/man ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/share/man/man1 ) ; then mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/include ) ; then mkdir -p $(DESTDIR)$(PREFIX)/include ; fi
+ cp -f bzip2 $(DESTDIR)$(EXEC_PREFIX)/bin/bzip2
+ cp -f bzip2 $(DESTDIR)$(EXEC_PREFIX)/bin/bunzip2
+ cp -f bzip2 $(DESTDIR)$(EXEC_PREFIX)/bin/bzcat
@ -88,10 +108,6 @@ diff -Paur --no-dereference -- bzip2.upstream/Makefile bzip2/Makefile
+ chmod a+x $(DESTDIR)$(EXEC_PREFIX)/bin/bzip2recover
+ cp -f bzip2.1 $(DESTDIR)$(PREFIX)/share/man/man1
+ chmod a+r $(DESTDIR)$(PREFIX)/share/man/man1/bzip2.1
+ cp -f bzlib.h $(DESTDIR)$(PREFIX)/include
+ chmod a+r $(DESTDIR)$(PREFIX)/include/bzlib.h
+ cp -f libbz2.a $(DESTDIR)$(EXEC_PREFIX)/lib
+ chmod a+r $(DESTDIR)$(EXEC_PREFIX)/lib/libbz2.a
+ cp -f bzgrep $(DESTDIR)$(EXEC_PREFIX)/bin/bzgrep
+ ln -s -f bzgrep $(DESTDIR)$(EXEC_PREFIX)/bin/bzegrep
+ ln -s -f bzgrep $(DESTDIR)$(EXEC_PREFIX)/bin/bzfgrep
@ -113,17 +129,3 @@ diff -Paur --no-dereference -- bzip2.upstream/Makefile bzip2/Makefile
clean:
rm -f *.o libbz2.a bzip2 bzip2recover \
diff -Paur --no-dereference -- bzip2.upstream/make.sortix bzip2/make.sortix
--- bzip2.upstream/make.sortix
+++ bzip2/make.sortix
@@ -0,0 +1,10 @@
+#!/bin/sh
+exec "$MAKE" "$@" \
+ PREFIX="$PREFIX" \
+ EXEC_PREFIX="$EXEC_PREFIX" \
+ DESTDIR="$DESTDIR" \
+ CC=${HOST}-gcc \
+ AR=${HOST}-ar \
+ RANLIB=${HOST}-ranlib \
+ BIGFILES= \
+#

View file

@ -1,11 +1,11 @@
NAME=bzip2
BUILD_LIBRARIES=
VERSION=1.0.6
BUILD_LIBRARIES=libbz2
VERSION=1.0.8
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd
SHA256SUM=ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
UPSTREAM_SITE=https://sourceware.org/pub/bzip2
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=sortix-usual-makefile
MAKE=./make.sortix
LICENSE=bzip2-1.0.6
BUILD_SYSTEM=makefile

7
ports/libbz2/libbz2.port Normal file
View file

@ -0,0 +1,7 @@
NAME=libbz2
BUILD_LIBRARIES=
SOURCE_PORT=bzip2
LICENSE=bzip2-1.0.6
BUILD_SYSTEM=makefile
MAKE_BUILD_TARGET=libbz2
MAKE_INSTALL_TARGET=install-libbz2

View file

@ -1,5 +1,5 @@
NAME=libcairo
BUILD_LIBRARIES='libz bzip2 libpng libfreetype libfontconfig? librsvg? libexpat? libpixman libglib?'
BUILD_LIBRARIES='libz libbz2 libpng libfreetype libfontconfig? librsvg? libexpat? libpixman libglib?'
VERSION=1.12.14
DISTNAME=cairo-$VERSION
COMPRESSION=tar.xz

View file

@ -1,5 +1,5 @@
NAME=libfreetype
BUILD_LIBRARIES='libz bzip2? libpng?'
BUILD_LIBRARIES='libz libbz2? libpng?'
VERSION=2.8.1
DISTNAME=freetype-$VERSION
COMPRESSION=tar.bz2

View file

@ -1,5 +1,5 @@
NAME=libpcre
BUILD_LIBRARIES='libstdc++ libz bzip2 libedit? libreadline?'
BUILD_LIBRARIES='libstdc++ libz libbz2 libedit? libreadline?'
VERSION=8.39
DISTNAME=pcre-$VERSION
COMPRESSION=tar.bz2

View file

@ -1,5 +1,5 @@
NAME=python
BUILD_LIBRARIES='bzip2 libcurses libexpat libffi libreadline libssl libz liblzma libiconv? libintl? llibmpdec?'
BUILD_LIBRARIES='libbz2 libcurses libexpat libffi libreadline libssl libz liblzma libiconv? libintl? llibmpdec?'
VERSION=3.6.0
DISTNAME=Python-$VERSION
COMPRESSION=tar.xz

View file

@ -1,5 +1,5 @@
NAME=qemu
BUILD_LIBRARIES='libstdc++ libz libglib libpixman bzip2? libSDL? libcurses? libcurl? libGL? libgtk? libssh2? libgcrypt? libtasn1?'
BUILD_LIBRARIES='libstdc++ libz libglib libpixman libbz2? libSDL? libcurses? libcurl? libGL? libgtk? libssh2? libgcrypt? libtasn1?'
VERSION=2.7.0
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.bz2

View file

@ -1,5 +1,5 @@
NAME=xorriso
BUILD_LIBRARIES='libiconv libz? bzip2? libreadline?'
BUILD_LIBRARIES='libiconv libz? libbz2? libreadline?'
VERSION=1.3.8
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz