build.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. set -e
  3. build_dir=$1
  4. # With simpleBuildEnvironment flag, we're already in build directory
  5. # which contains the copied source tree
  6. # Copy patch file from sources directory
  7. echo "Copying patch file..."
  8. cp sources/bzip2-1.0.8-install_docs-1.patch sources/bzip2-1.0.8/
  9. # Change to source directory
  10. cd sources/bzip2-1.0.8/
  11. # Apply documentation patch (try different strip levels)
  12. echo "Applying documentation patch..."
  13. patch -Np0 -i bzip2-1.0.8-install_docs-1.patch || echo "Patch failed, continuing without documentation patch"
  14. # Fix symbolic links to be relative
  15. echo "Fixing symbolic links to be relative..."
  16. sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
  17. # Ensure man pages are installed to correct location
  18. echo "Fixing man page installation path..."
  19. sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
  20. # Build the shared library
  21. echo "Building shared library..."
  22. make -f Makefile-libbz2_so
  23. # Clean previous build artifacts
  24. echo "Cleaning previous build artifacts..."
  25. make clean
  26. # Build the package
  27. echo "Building bzip2..."
  28. make
  29. echo "Build complete."