recipe 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Build recipe for librsvg.
  2. #
  3. # Copyright (C) 2018, MMPG <mmpg@vp.pl>
  4. # Copyright (c) 2018-2019, 2021 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=librsvg
  20. version=2.40.21
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=libs
  24. tarname=${program}-${version}.tar.xz
  25. # Remote source(s)
  26. fetch="https://download.gnome.org/sources/librsvg/${version%.*}/$tarname"
  27. description="
  28. A high performance SVG rendering library.
  29. The librsvg package contains librsvg libraries and tools used to
  30. manipulate, convert and view Scalable Vector Graphic images.
  31. "
  32. homepage=https://wiki.gnome.org/Projects/LibRsvg
  33. license="GPLv2+, LGPLv2+"
  34. # Source documentation
  35. docs="AUTHORS COPYING* NEWS README"
  36. docsdir="${docdir}/${program}-${version}"
  37. build()
  38. {
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Apply patches from Debian (Thanks!)
  42. patch -Np1 -i "${worktree}/patches/librsvg/10_rsvg-gz.patch"
  43. patch -Np1 -i "${worktree}/patches/librsvg/remove-tests.patch"
  44. patch -Np1 -i "${worktree}/patches/librsvg/hide-private-symbol.patch"
  45. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
  46. LDFLAGS="$QILDFLAGS -Wl,--no-keep-memory,-z,defs -Wl,-O1 -Wl,--as-needed" \
  47. $configure_args \
  48. --mandir=$mandir \
  49. --libdir=/usr/lib${libSuffix} \
  50. --enable-static=no \
  51. --enable-shared=yes \
  52. --enable-pixbuf-loader \
  53. --enable-introspection \
  54. --enable-vala \
  55. --disable-rpath \
  56. --build="$(gcc -dumpmachine)"
  57. make -j${jobs} V=1
  58. make -j${jobs} V=1 DESTDIR="$destdir" install-strip
  59. # Compress and link man pages (if needed)
  60. if test -d "${destdir}/$mandir"
  61. then
  62. (
  63. cd "${destdir}/$mandir"
  64. find . -type f -exec lzip -9 {} +
  65. find . -type l | while read -r file
  66. do
  67. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  68. rm -- "$file"
  69. done
  70. )
  71. fi
  72. # Copy documentation
  73. mkdir -p "${destdir}/$docsdir"
  74. cp -p $docs "${destdir}/$docsdir"
  75. }