recipe 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # Build recipe for poppler.
  2. #
  3. # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
  4. # Copyright (c) 2021-2022 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. # Exit immediately on any error
  18. set -e
  19. program=poppler
  20. version=22.12.0
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=x-libs
  24. tarname=${program}-${version}.tar.xz
  25. # Remote source(s)
  26. fetch=https://poppler.freedesktop.org/"$tarname"
  27. description="
  28. A PDF rendering library based on the XPDF-3.0 code base.
  29. The poppler package contains a PDF rendering library and command line
  30. tools used to manipulate PDF files. This is useful for providing PDF
  31. rendering functionality as a shared library.
  32. "
  33. homepage=https://poppler.freedesktop.org/
  34. license="GPLv2+, GPLv3+"
  35. # Source documentation
  36. docs="AUTHORS COPYING* ChangeLog NEWS README*"
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. rm -rf BUILD
  45. mkdir BUILD
  46. cd BUILD
  47. cmake \
  48. -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS" \
  49. -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS" \
  50. -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS" \
  51. -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
  52. -DCMAKE_INSTALL_PREFIX=/usr \
  53. -DLIB_SUFFIX=/usr/lib${libSuffix} \
  54. -DCMAKE_INSTALL_MANDIR=$mandir \
  55. -DCMAKE_INSTALL_DOCDIR=$docsdir \
  56. -DCMAKE_BUILD_TYPE=Release \
  57. -DCMAKE_VERBOSE_MAKEFILE=ON \
  58. -DCMAKE_SKIP_INSTALL_RPATH=YES \
  59. -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
  60. -DENABLE_BOOST=OFF \
  61. -G Ninja ..
  62. ninja -j${jobs}
  63. DESTDIR="$destdir" ninja -j${jobs} install
  64. # Compress info documents deleting index file for the package
  65. if test -d "${destdir}/$infodir"
  66. then
  67. rm -f "${destdir}/${infodir}/dir"
  68. lzip -9 "${destdir}/${infodir}"/*
  69. fi
  70. # Compress and link man pages (if needed)
  71. if test -d "${destdir}/$mandir"
  72. then
  73. (
  74. cd "${destdir}/$mandir"
  75. find . -type f -exec lzip -9 '{}' +
  76. find . -type l | while read -r file
  77. do
  78. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  79. rm -- "$file"
  80. done
  81. )
  82. fi
  83. # Leave the temporary BUILD directory
  84. cd ..
  85. # Copy documentation
  86. mkdir -p "${destdir}/$docsdir"
  87. cp -p $docs "${destdir}/$docsdir"
  88. }