Fixed bzip2 (excluding man pages)

This commit is contained in:
Alexander Hill 2025-11-29 16:52:24 -05:00
parent d4dd608a1f
commit c1a0e67c30
2 changed files with 28 additions and 13 deletions

View File

@ -11,7 +11,7 @@ Definitions:
| `bsdutils` | Yes | No | | `bsdutils` | Yes | No |
| `busybox` | No | No | | `busybox` | No | No |
| `byacc` | Yes | Yes | | `byacc` | Yes | Yes |
| `bzip2` | Yes | No | | `bzip2` | Yes | Yes |
| `cmake` | Yes | No | | `cmake` | Yes | No |
| `editline` | Yes | Yes | | `editline` | Yes | Yes |
| `flex` | Yes | Yes | | `flex` | Yes | Yes |

View File

@ -2,10 +2,9 @@
SRC_HASH="ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" SRC_HASH="ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"
SRC_NAME="bzip2" SRC_NAME="bzip2"
SRC_URL="https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" SRC_URL="https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
SRC_VERSION="1.0.8" SRC_VERSION="1.0.8r1"
# TODO: Move bzlib.h to $TT_INCLUDEDIR ~ahill # TODO: Install the man pages ~ahill
# TODO: Prevent the static library from being installed ~ahill
build() { build() {
tar xf ../$SRC_FILENAME tar xf ../$SRC_FILENAME
@ -15,11 +14,10 @@ build() {
# NOTE: -D_FILE_OFFSET_BITS is present because it's present in the Makefile # NOTE: -D_FILE_OFFSET_BITS is present because it's present in the Makefile
# and we're completely overriding its defaults. I don't actually know # and we're completely overriding its defaults. I don't actually know
# if this will cause any issues if it's missing. ~ahill # if this will cause any issues if it's missing. ~ahill
make -O -j $TT_PROCS CC=$CC CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" PREFIX=/ make -O -f Makefile-libbz2_so -j $TT_PROCS CC=$CC CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
# NOTE: I'm not sure if it's possible to build bzip2 without building a # NOTE: bzip2recover is part of the first Makefile, so we need to invoke
# static library, since the executable links with the static library # that to build the command. ~ahill
# and the shared library is isolated in a separate Makefile. ~ahill make -O -j $TT_PROCS bzip2recover CC=$CC CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
make -O -f Makefile-libbz2_so -j $TT_PROCS CC=$CC CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" PREFIX=/
} }
clean() { clean() {
@ -28,8 +26,25 @@ clean() {
package() { package() {
cd bzip2-*/ cd bzip2-*/
make -O -j $TT_PROCS install PREFIX=$TT_INSTALLDIR # NOTE: The shared Makefile doesn't have an "install" target, so we just
# NOTE: The second Makefile doesn't have an "install" target, so we just # copy the files over ourselves. ~ahill
# toss the shared object into /lib and call it a day! ~ahill mkdir -p $TT_INSTALLDIR$TT_BINDIR
cp libbz2.so* $TT_INSTALLDIR/lib/ cp bzdiff $TT_INSTALLDIR$TT_BINDIR/
chmod +x $TT_INSTALLDIR$TT_BINDIR/bzdiff
ln -sf bzdiff $TT_INSTALLDIR$TT_BINDIR/bzcmp
cp bzgrep $TT_INSTALLDIR$TT_BINDIR/
chmod +x $TT_INSTALLDIR$TT_BINDIR/bzgrep
ln -sf bzgrep $TT_INSTALLDIR$TT_BINDIR/bzegrep
ln -sf bzgrep $TT_INSTALLDIR$TT_BINDIR/bzfgrep
cp bzip2recover $TT_INSTALLDIR$TT_BINDIR/
cp bzmore $TT_INSTALLDIR$TT_BINDIR/
chmod +x $TT_INSTALLDIR$TT_BINDIR/bzmore
ln -sf bzmore $TT_INSTALLDIR$TT_BINDIR/bzless
cp bzip2-shared $TT_INSTALLDIR$TT_BINDIR/bzip2
ln -sf bzip2 $TT_INSTALLDIR$TT_BINDIR/bunzip2
ln -sf bzip2 $TT_INSTALLDIR$TT_BINDIR/bzcat
mkdir -p $TT_INSTALLDIR$TT_LIBDIR
cp libbz2.so* $TT_INSTALLDIR$TT_LIBDIR/
mkdir -p $TT_INSTALLDIR$TT_INCLUDEDIR
cp bzlib.h $TT_INSTALLDIR$TT_INCLUDEDIR/
} }