From 50fbef6a5f6df69c93786f9b6946727d1b02e84c Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 27 Nov 2023 11:09:41 -0300 Subject: [PATCH] ports: zlib and bzip2 --- patches/bzip2/jinx-working-patch.patch | 35 ++++++++++++++++++++++++++ recipes/bzip2 | 29 +++++++++++++++++++++ recipes/tar | 2 +- recipes/zlib | 18 +++++++++++++ source-recipes/bzip2 | 10 ++++++++ source-recipes/zlib | 10 ++++++++ 6 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 patches/bzip2/jinx-working-patch.patch create mode 100644 recipes/bzip2 create mode 100644 recipes/zlib create mode 100644 source-recipes/bzip2 create mode 100644 source-recipes/zlib diff --git a/patches/bzip2/jinx-working-patch.patch b/patches/bzip2/jinx-working-patch.patch new file mode 100644 index 00000000..29955645 --- /dev/null +++ b/patches/bzip2/jinx-working-patch.patch @@ -0,0 +1,35 @@ +diff --git bzip2-clean/Makefile bzip2-workdir/Makefile +index f8a1772..3620662 100644 +--- bzip2-clean/Makefile ++++ bzip2-workdir/Makefile +@@ -35,7 +35,7 @@ OBJS= blocksort.o \ + decompress.o \ + bzlib.o + +-all: libbz2.a bzip2 bzip2recover test ++all: libbz2.a bzip2 bzip2recover + + bzip2: libbz2.a bzip2.o + $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 +@@ -54,20 +54,7 @@ libbz2.a: $(OBJS) + + check: test + test: bzip2 +- @cat words1 +- ./bzip2 -1 < sample1.ref > sample1.rb2 +- ./bzip2 -2 < sample2.ref > sample2.rb2 +- ./bzip2 -3 < sample3.ref > sample3.rb2 +- ./bzip2 -d < sample1.bz2 > sample1.tst +- ./bzip2 -d < sample2.bz2 > sample2.tst +- ./bzip2 -ds < sample3.bz2 > sample3.tst +- cmp sample1.bz2 sample1.rb2 +- cmp sample2.bz2 sample2.rb2 +- cmp sample3.bz2 sample3.rb2 +- cmp sample1.tst sample1.ref +- cmp sample2.tst sample2.ref +- cmp sample3.tst sample3.ref +- @cat words3 ++ echo bleh + + install: bzip2 bzip2recover + if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi diff --git a/recipes/bzip2 b/recipes/bzip2 new file mode 100644 index 00000000..4f47c3f8 --- /dev/null +++ b/recipes/bzip2 @@ -0,0 +1,29 @@ +name=bzip2 +revision=1 +from_source=bzip2 +imagedeps="base-devel" +hostdeps="xgcc xbinutils" +deps="mlibc" + +configure() { + cp -rpf ${source_dir}/* . + sed -i 's@\(ln -s -f \)$(prefix)/bin/@\1@' Makefile + sed -i "s@(prefix)/man@(prefix)/share/man@g" Makefile + make -f Makefile-libbz2_so CC=x86_64-astral-gcc + make clean +} + +build() { + make -j${parallelism} CC=x86_64-astral-gcc +} + +install() { + make install PREFIX=${dest_dir}/${prefix} + cp -av libbz2.so.* ${dest_dir}/${prefix}/lib + ln -sv libbz2.so.1.0.8 ${dest_dir}${prefix}/lib/libbz2.so + cp -v bzip2-shared ${dest_dir}/${prefix}/bin/bzip2 + for i in ${dest_dir}/${prefix}/bin/{bzcat,bunzip2}; do + ln -sfv bzip2 $i + done + rm -fv ${dest_dir}/${prefix}/lib/libbz2.a +} diff --git a/recipes/tar b/recipes/tar index b54e75bd..94070add 100644 --- a/recipes/tar +++ b/recipes/tar @@ -3,7 +3,7 @@ revision=1 from_source=tar imagedeps="base-devel" hostdeps="xgcc xbinutils" -deps="mlibc xz" +deps="mlibc xz bzip2 zlib" configure() { cp -rpf ${source_dir}/* . diff --git a/recipes/zlib b/recipes/zlib new file mode 100644 index 00000000..3165f562 --- /dev/null +++ b/recipes/zlib @@ -0,0 +1,18 @@ +name=zlib +revision=1 +from_source=zlib +imagedeps="base-devel" +hostdeps="xgcc xbinutils" +deps="mlibc" + +configure() { + CHOST=x86_64-astral prefix=${prefix} ${source_dir}/configure +} + +build() { + make -j${parallelism} +} + +install() { + make install DESTDIR="${dest_dir}" +} diff --git a/source-recipes/bzip2 b/source-recipes/bzip2 new file mode 100644 index 00000000..d93595af --- /dev/null +++ b/source-recipes/bzip2 @@ -0,0 +1,10 @@ +name=bzip2 +version=1.0.8 +source_method=tarball +tarball_url="https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz" +tarball_sha512=083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3 +hostdeps="autoconf automake libtool pkgconfig" + +regenerate() { + true +} diff --git a/source-recipes/zlib b/source-recipes/zlib new file mode 100644 index 00000000..e2bcc809 --- /dev/null +++ b/source-recipes/zlib @@ -0,0 +1,10 @@ +name=zlib +version=1.3 +source_method=tarball +tarball_url="https://www.zlib.net/zlib-${version}.tar.xz" +tarball_sha512=3868ac4da5842dd36c9dad794930675b9082ce15cbd099ddb79c0f6bd20a24aa8f33a123f378f26fe0ae02d91f31f2994dccaac565cedeaffed7b315e6ded2a2 +hostdeps="autoconf automake libtool pkgconfig" + +regenerate() { + true +}