recipe 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Build recipe for libopenjpeg2.
  2. #
  3. # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. program=openjpeg
  17. version=2.3.0
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. tarname=v${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://github.com/uclouvain/openjpeg/archive/"$tarname"
  24. description="
  25. OpenJPEG is an open-source JPEG 2000 codec.
  26. OpenJPEG is written in C language. It has been developed in order to promote
  27. the use of JPEG 2000, a still-image compression standard from the Joint
  28. Photographic Experts Group (JPEG). Since may 2015, it is officially recognized
  29. by ISO/IEC and ITU-T as a JPEG 2000 Reference Software.
  30. "
  31. homepage=http://www.openjpeg.org/
  32. license="BSD 2-clause"
  33. # Source documentation
  34. docs="AUTHORS.md LICENSE CHANGELOG.md NEWS.md README.md"
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. set -e
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. rm -rf BUILD
  42. mkdir BUILD
  43. cd BUILD
  44. #patch -Np0 -i ${worktree}/patches/openjpeg/openjpeg2_install.patch
  45. cmake \
  46. -DCMAKE_C_FLAGS:STRING="$QICFLAGS" \
  47. -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS" \
  48. -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
  49. -DCMAKE_INSTALL_PREFIX=/usr \
  50. -DLIB_SUFFIX=/usr/lib${libSuffix} \
  51. -DCMAKE_INSTALL_MANDIR=$mandir \
  52. -DCMAKE_INSTALL_DOCDIR=$docsdir \
  53. -DCMAKE_BUILD_TYPE=Release \
  54. ..
  55. #-DBUILD_STATIC_LIBS=OFF \
  56. make -j${jobs} V=1
  57. make -j${jobs} DESTDIR="$destdir" install
  58. # Compress info documents deleting index file for the package
  59. if test -d "${destdir}/$infodir"
  60. then
  61. rm -f "${destdir}/${infodir}/dir"
  62. lzip -9 "${destdir}/${infodir}"/*
  63. fi
  64. # Compress and link man pages (if needed)
  65. if test -d "${destdir}/$mandir"
  66. then
  67. (
  68. cd "${destdir}/$mandir"
  69. find . -type f -exec lzip -9 '{}' +
  70. find . -type l | while read -r file
  71. do
  72. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  73. rm -- "$file"
  74. done
  75. )
  76. fi
  77. # Leave the BUILD dir
  78. cd ..
  79. # Copy documentation
  80. mkdir -p "${destdir}${docsdir}"
  81. cp -p $docs "${destdir}${docsdir}/"
  82. }