recipe 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. # Build recipe for tqt3 (trinity).
  2. #
  3. # Copyright (c) 2019-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=tqt3
  19. version=20220430_ec04b50a
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=tde
  23. tarname=${program}-${version}.tar.lz
  24. # Remote source(s)
  25. fetch="
  26. https://dragora.mirror.garr.it/current/sources/$tarname
  27. rsync://rsync.dragora.org/current/sources/$tarname
  28. "
  29. description="
  30. Qt is a multiplatform C++ GUI application framework.
  31. Qt 3.3 introduces new features and many improvements over
  32. the 3.2.x series. See the changes file for details.
  33. The Qt version 3.3 series is binary compatible with the
  34. 3.2.x series - applications compiled for 3.2 will continue
  35. to run with 3.3.
  36. "
  37. homepage=https://www.trinitydesktop.org/
  38. license="GPLv2+, GPLv3+ | The Q Public License"
  39. # Source documentation
  40. docs="FAQ LICENSE* README*"
  41. docsdir="${docdir}/${program}-${version}"
  42. build()
  43. {
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. # Remove unneeded specs for targets other than GNU/Linux
  47. ( cd mkspecs && find . -maxdepth 1 \( -type d -a ! -name 'linux-g++' \) -exec rm -rf -- '{}' \; )
  48. # Do not build the HTML documentation in order to save disk space
  49. #sed -i '/htmldocs/d' src/qt_install.pri
  50. # Set custom compilation flags from Qi
  51. sed -i \
  52. -e "s:QMAKE_CFLAGS_RELEASE.*=:QMAKE_CFLAGS_RELEASE=${QICXXFLAGS} :" \
  53. mkspecs/linux*/qmake.conf
  54. # Set sane permissions
  55. chmod -R u+w,go-w,a+rX-s .
  56. LD_LIBRARY_PATH="${PWD}/lib:${LD_LIBRARY_PATH}"
  57. LD_LIBRARY_PATH="${LD_LIBRARY_PATH%%:*}"; # Get the rid of ":".
  58. export LD_LIBRARY_PATH
  59. echo "New LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
  60. echo yes | ./configure \
  61. -L/usr/lib${libSuffix} \
  62. -I/usr/include/freetype2 \
  63. -I/usr/include/tirpc \
  64. -prefix "/usr" \
  65. -libdir "/usr/lib${libSuffix}" \
  66. -sysconfdir "/etc/tqt3" \
  67. -headerdir "/usr/include/tqt3" \
  68. -plugindir "/usr/lib${libSuffix}/tqt3/plugins" \
  69. -datadir "/usr/share/tqt3" \
  70. -translationdir "/usr/share/tqt3/translations" \
  71. -docdir "$docsdir" \
  72. -no-exceptions \
  73. -qt-gif \
  74. -system-zlib \
  75. -system-libpng \
  76. -system-libjpeg \
  77. -system-libmng \
  78. -qt-imgfmt-mng \
  79. -qt-imgfmt-png \
  80. -qt-imgfmt-jpeg \
  81. -plugin-imgfmt-mng \
  82. -thread \
  83. -shared \
  84. -fast \
  85. -glibmainloop \
  86. -tablet \
  87. -enable-opengl \
  88. -dlopen-opengl \
  89. -nis \
  90. -sm \
  91. -xshape \
  92. -xinerama \
  93. -xcursor \
  94. -xrandr \
  95. -xft \
  96. -xrender \
  97. -xkb \
  98. -release
  99. make -i -j${jobs} sub-tools
  100. make -j${jobs} INSTALL_ROOT="$destdir" install
  101. unset -v LD_LIBRARY_PATH
  102. # Strip remaining binaries and libraries
  103. find "$destdir" -type f | xargs file | \
  104. awk '/ELF/ && /executable/ || /shared object/' | \
  105. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  106. # Compress and link man pages (if needed)
  107. if test -d "${destdir}/$mandir"
  108. then
  109. (
  110. cd "${destdir}/$mandir"
  111. find . -type f -exec lzip -9 {} +
  112. find . -type l | while read -r file
  113. do
  114. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  115. rm -- "$file"
  116. done
  117. )
  118. fi
  119. # Copy documentation
  120. mkdir -p "${destdir}/$docsdir"
  121. cp -p $docs "${destdir}/$docsdir"
  122. }