recipe 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Build recipe for libpng.
  2. #
  3. # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
  4. # Copyright (c) 2017-2019 Matias Fonzo, <selk@dragora.org>.
  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. program=libpng
  18. version=1.6.37
  19. release=1
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/libs"
  22. description="
  23. The main PNG library.
  24. libpng is the official PNG reference library. It supports almost
  25. all PNG features, is extensible, and has been extensively tested
  26. for over 20 years.
  27. "
  28. homepage=http://www.libpng.org/pub/png/libpng.html
  29. license="libpng license"
  30. tarname=${program}-${version}.tar.gz
  31. # Remote source(s)
  32. fetch=http://downloads.sourceforge.net/project/libpng/libpng16/${version}/$tarname
  33. # Source documentation
  34. docs="ANNOUNCE CHANGES LICENSE README TODO"
  35. docsdir="${docdir}/${program}-${version}"
  36. build() {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. # Include animated PNG functionality in libpng
  43. patch -p1 < "${worktree}/patches/libpng/libpng-1.6.37-apng.patch"
  44. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LIBS='-lpthread' \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --infodir=$infodir \
  48. --mandir=$mandir \
  49. --docdir=$docsdir \
  50. --enable-static=no \
  51. --enable-shared=yes \
  52. --build="$(cc -dumpmachine)"
  53. make -j${jobs} V=1
  54. make -j${jobs} DESTDIR="$destdir" install-strip
  55. # Compress manual pages
  56. if [ -d "${destdir}/$mandir" ] ; then
  57. (
  58. cd "${destdir}/$mandir"
  59. find . -type f -exec lzip -9 '{}' +
  60. find . -type l | while read -r file
  61. do
  62. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  63. rm -- "$file"
  64. done
  65. )
  66. fi
  67. # Copy documentation
  68. mkdir -p "${destdir}${docsdir}"
  69. cp -p $docs "${destdir}${docsdir}/"
  70. }