recipe 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Build recipe for exiv2.
  2. #
  3. # Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
  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. # Exit immediately on any error
  17. set -e
  18. program=exiv2
  19. version=0.27.5
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=x-libs
  23. tarname=${program}-${version}-Source.tar.gz
  24. # Remote source(s)
  25. fetch=https://github.com/Exiv2/exiv2/releases/download/v${version}/$tarname
  26. description="
  27. Exif, IPTC & XMP metadata and ICC Profile.
  28. Exiv2 is a Cross-platform C++ library and a command line utility to manage
  29. image metadata. It provides fast and easy read and write access to the
  30. Exif, IPTC and XMP metadata and the ICC Profile embedded within digital
  31. images in various formats. Exiv2 is available as free software and is
  32. used in many projects including KDE and Gnome Desktops as well as many
  33. applications including GIMP, darktable, shotwell, GwenView and Luminance
  34. HDR.
  35. "
  36. homepage=https://exiv2.org/index.html
  37. license=GPLv2+
  38. # Source documentation
  39. docs="AUTHORS *_GUIDELINES.md CONTRIBUTING.md COPYING README* SECURITY.md WORK-IN-PROGRESS"
  40. docsdir="${docdir}/${program}-${version}"
  41. # The source has a custom directory name
  42. srcdir=${program}-${version}-Source
  43. build()
  44. {
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. rm -rf BUILD
  50. mkdir BUILD
  51. cd BUILD
  52. cmake -DCMAKE_BUILD_TYPE=Release \
  53. -DCMAKE_CXX_FLAGS="$QICXXFLAGS" \
  54. -DCMAKE_EXE_LINKER_FLAGS="$QILDFLAGS" \
  55. -DCMAKE_SHARED_LINKER_FLAGS="$QILDFLAGS" \
  56. -DCMAKE_STATIC_LINKER_FLAGS="$QILDFLAGS" \
  57. -DCMAKE_INSTALL_PREFIX=/usr \
  58. -DCMAKE_INSTALL_LIBDIR=lib${libSuffix} \
  59. -DCMAKE_INSTALL_MANDIR=$mandir \
  60. -DCMAKE_INSTALL_DOCDIR=$docsdir \
  61. -DEXIV2_ENABLE_NLS=ON \
  62. -DEXIV2_ENABLE_VIDEO=ON \
  63. -DEXIV2_ENABLE_WEBREADY=ON \
  64. -DEXIV2_ENABLE_CURL=ON \
  65. -DEXIV2_ENABLE_BMFF=ON \
  66. -DBUILD_WITH_CCACHE=ON \
  67. -G Ninja ..
  68. ninja -j${jobs}
  69. DESTDIR="$destdir" ninja -j${jobs} install
  70. # Switch back to the main source directory
  71. cd ..
  72. # Compress and link man pages (if needed)
  73. if test -d "${destdir}/$mandir"
  74. then
  75. (
  76. cd "${destdir}/$mandir"
  77. find . -type f -exec lzip -9 {} +
  78. find . -type l | while read -r file
  79. do
  80. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  81. rm -- "$file"
  82. done
  83. )
  84. fi
  85. # Copy documentation
  86. mkdir -p "${destdir}/$docsdir"
  87. cp -p $docs "${destdir}/$docsdir"
  88. }