recipe 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Build recipe for squashfs-tools.
  2. #
  3. # Copyright (c) 2021 Matias Fonzo, <selk@dragora.org>.
  4. # Copyright (c) 2022 DustDFG, <dfgdust@gmail.com>.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. # Exit immediately on any error
  18. set -e
  19. program=squashfs
  20. pkgname=squashfs-tools
  21. version=4.5
  22. release=1
  23. # Define a category for the output of the package name
  24. pkgcategory=tools
  25. tarname=${program}${version}.tar.gz
  26. # Remote source(s)
  27. fetch=https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs${version}/$tarname
  28. description="
  29. Tools to create and extract Squashfs filesystems.
  30. This is a squashed read-only filesystem for GNU/Linux.
  31. "
  32. homepage=https://github.com/plougher/squashfs-tools/
  33. license=GPLv2+
  34. # Source documentation
  35. docs="
  36. ACKNOWLEDGEMENTS ACTIONS-README CHANGES COPYING README-${version} USAGE
  37. RELEASE-READMEs/DONATIONS RELEASE-READMEs/pseudo-file.example
  38. "
  39. docsdir="${docdir}/${pkgname}-${version}"
  40. # The source has a custom directory
  41. srcdir=${pkgname}-${version}
  42. build()
  43. {
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. # Apply a patch to include LZIP support
  47. patch -p1 < "${worktree}/patches/squashfs-tools/squashfs-tools-4.5_lzip-0.diff"
  48. # Set sane permissions
  49. chmod -R u+w,go-w,a+rX-s .
  50. cd squashfs-tools
  51. make -j${jobs} CC=cc EXTRA_CFLAGS="$QICFLAGS -O3" LDFLAGS="$QILDFLAGS" \
  52. GZIP_SUPPORT=1 \
  53. LZIP_SUPPORT=1 \
  54. XZ_SUPPORT=1 \
  55. LZO_SUPPORT=0 \
  56. LZ4_SUPPORT=0 \
  57. ZSTD_SUPPORT=0 \
  58. COMP_DEFAULT=lzip \
  59. XATTR_SUPPORT=1 \
  60. install INSTALL_DIR="${destdir}/usr/bin"
  61. cd ../
  62. # Re-create symlinks for utilities
  63. (
  64. cd "${destdir}/usr/bin" || exit 1
  65. ln -sf mksquashfs sqfscat
  66. ln -sf unsquashfs sqfstar
  67. )
  68. # Copy documentation
  69. mkdir -p "${destdir}/$docsdir"
  70. cp -p $docs "${destdir}/$docsdir"
  71. }