recipe 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. # Build recipe for tqt3 (trinity).
  2. #
  3. # Copyright (c) 2019-2021 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-trinity
  19. pkgname=tqt3
  20. version=14.0.9
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=tde
  24. tarname=${program}-${version}.tar.xz
  25. # Remote source(s)
  26. fetch=https://mirror.ppa.trinitydesktop.org/trinity/releases/R${version}/main/dependencies/$tarname
  27. description="
  28. Qt is a multiplatform C++ GUI application framework.
  29. Qt 3.3 introduces new features and many improvements over the 3.2.x
  30. series. See the changes file for details.
  31. The Qt version 3.3 series is binary compatible with the 3.2.x series -
  32. applications compiled for 3.2 will continue to run with 3.3.
  33. "
  34. homepage=https://www.trinitydesktop.org/
  35. license="GPLv2+, GPLv3+ | The Q Public License"
  36. # Source documentation
  37. docs="FAQ LICENSE* README*"
  38. docsdir="${docdir}/${pkgname}-${version}"
  39. build()
  40. {
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Remove unneeded specs for targets other than GNU/Linux
  44. ( cd mkspecs && find . -maxdepth 1 \( -type d -a ! -name 'linux-g++' \) -exec rm -rf -- '{}' \; )
  45. # Do not build the HTML documentation in order to save disk space
  46. #sed -i '/htmldocs/d' src/qt_install.pri
  47. # Set custom compilation flags from Qi
  48. sed -i \
  49. -e "s:QMAKE_CFLAGS_RELEASE.*=:QMAKE_CFLAGS_RELEASE=${QICXXFLAGS} :" \
  50. mkspecs/linux*/qmake.conf
  51. # Set sane permissions
  52. chmod -R u+w,go-w,a+rX-s .
  53. SAVED_QTDIR="$QTDIR"
  54. QTDIR="$PWD"
  55. LD_LIBRARY_PATH="${PWD}/lib:${LD_LIBRARY_PATH}"
  56. SAVED_PATH="$PATH"
  57. PATH="${PWD}/bin:${PATH}"
  58. echo ""
  59. echo "New QTDIR: $QTDIR"
  60. echo "New LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
  61. echo "New PATH: $PATH"
  62. echo ""
  63. export QTDIR LD_LIBRARY_PATH PATH
  64. echo yes | ./configure -L/usr/lib${libSuffix} -I/usr/include/tirpc \
  65. -prefix /opt/trinity/lib${libSuffix}/${pkgname}-${version} \
  66. -plugindir /opt/trinity/lib${libSuffix}/${pkgname}-${version}/plugins \
  67. -sysconfdir /opt/etc \
  68. -sysshare /usr/share \
  69. -docdir $docsdir \
  70. -no-exceptions \
  71. -stl \
  72. -largefile \
  73. -qt-gif \
  74. -system-zlib \
  75. -system-libpng \
  76. -system-libjpeg \
  77. -system-libmng \
  78. -plugin-imgfmt-png \
  79. -plugin-imgfmt-jpeg \
  80. -plugin-imgfmt-mng \
  81. -thread \
  82. -xinerama \
  83. -xcursor \
  84. -xrandr \
  85. -xrender \
  86. -xft \
  87. -tablet \
  88. -xkb \
  89. -plugin-style-cde \
  90. -plugin-style-compact \
  91. -plugin-style-motif \
  92. -plugin-style-motifplus \
  93. -plugin-style-platinum \
  94. -plugin-style-sgi \
  95. -plugin-style-windows \
  96. -release
  97. make -i -j${jobs} sub-tools
  98. make -j${jobs} INSTALL_ROOT="$destdir" install
  99. PATH=$SAVED_PATH
  100. QTDIR=$SAVED_QTDIR
  101. unset -v SAVED_QTDIR SAVED_PATH LD_LIBRARY_PATH
  102. export PATH QTDIR
  103. # Strip remaining binaries and libraries
  104. find "$destdir" -type f | xargs file | \
  105. awk '/ELF/ && /executable/ || /shared object/' | \
  106. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  107. # Make symlinks in order to have canonical path(s)
  108. mkdir -p "${destdir}/var/lib/qi"
  109. cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
  110. # Make symlink for canonical path at /opt/trinity/lib
  111. # Link using \$libSuffix if it was present (recipe)
  112. test -n "$libSuffix" && ( cd opt/trinity && ln -sf lib${libSuffix} lib );
  113. # Link package name
  114. cd opt/trinity/lib && ln -sf ${pkgname}-${version} $pkgname
  115. echo "Updating desktop database: update-desktop-database -q usr/share/applications"
  116. update-desktop-database -q usr/share/applications
  117. EOF
  118. cd "${destdir}/opt/trinity" || exit 1
  119. # Link tqt3's pkg-config files at /opt/trinity/lib/pkgconfig
  120. mkdir -p "${destdir}/opt/trinity/lib${libSuffix}/pkgconfig"
  121. cd "${destdir}/opt/trinity/lib${libSuffix}/${pkgname}-${version}"/lib/pkgconfig/
  122. for file in *.pc
  123. do
  124. ln -sf \
  125. "/opt/trinity/lib${libSuffix}/${pkgname}-${version}/lib/pkgconfig/${file}" \
  126. "${destdir}/opt/trinity/lib${libSuffix}/pkgconfig/${file}"
  127. done
  128. # Link tqt3's programs at /opt/trinity/bin
  129. mkdir -p "${destdir}/opt/trinity/bin"
  130. cd "${destdir}/opt/trinity/lib${libSuffix}/${pkgname}-${version}"/bin/
  131. for file in *
  132. do
  133. test -x "$file" || continue;
  134. ln -sf \
  135. "/opt/trinity/lib${libSuffix}/${pkgname}-${version}/bin/${file}" \
  136. "${destdir}/opt/trinity/bin/${file}"
  137. done
  138. cd -- "${TMPDIR}/$srcdir"
  139. # Include profile file
  140. mkdir -p "${destdir}/etc/profile.d"
  141. cp -p "${worktree}/archive/tqt3/etc/profile.d/tqt3.sh" \
  142. "${destdir}/etc/profile.d/"
  143. chmod 644 "${destdir}/etc/profile.d/tqt3.sh"
  144. # To handle config file(s)
  145. touch "${destdir}/etc/profile.d/.graft-config"
  146. # Compress and link man pages (if needed)
  147. if test -d "${destdir}/$mandir"
  148. then
  149. (
  150. cd "${destdir}/$mandir"
  151. find . -type f -exec lzip -9 {} +
  152. find . -type l | while read -r file
  153. do
  154. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  155. rm -- "$file"
  156. done
  157. )
  158. fi
  159. # Copy documentation
  160. mkdir -p "${destdir}${docsdir}"
  161. cp -p $docs "${destdir}${docsdir}"
  162. }