recipe 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # Build recipe for tk (Tcl/Tk).
  2. #
  3. # Copyright (c) 2018-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=tk
  19. version=8.6.13
  20. series_version=8.6
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=devel
  24. tarname=${program}${version}-src.tar.gz
  25. # Remote source(s)
  26. fetch=https://prdownloads.sourceforge.net/tcl/$tarname
  27. homepage=https://www.tcl.tk
  28. description="
  29. The TCL GUI ToolKit.
  30. The tk package contains the TCL GUI ToolKit.
  31. For more information, visit:
  32. $homepage
  33. "
  34. license=Custom
  35. # Source documentation
  36. docs="ChangeLog README.md changes license.terms"
  37. docsdir="${docdir}/${program}-${version}"
  38. # Custom source directory
  39. #srcdir="${program}${version%.*}"
  40. srcdir="${program}${version}"
  41. build()
  42. {
  43. unpack "${tardir}/$tarname"
  44. cd "$srcdir"
  45. # Set sane permissions
  46. chmod -R u+w,go-w,a+rX-s .
  47. # Determine whether to use 64 bit support
  48. case $arch in
  49. amd64 | x32 )
  50. bit_flags=--enable-64bit
  51. ;;
  52. esac
  53. cd unix
  54. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
  55. LDFLAGS="$QILDFLAGS" \
  56. $configure_args \
  57. --libdir=/usr/lib${libSuffix} \
  58. --infodir=$infodir \
  59. --mandir=$mandir \
  60. --enable-shared \
  61. --enable-threads \
  62. --enable-man-symlinks \
  63. --without-tzdata \
  64. --build="$(gcc -dumpmachine)" \
  65. $bit_flags
  66. unset -v bit_flags
  67. make -j${jobs} V=1
  68. # Thanks to "Beyond of Linux From Scratch"
  69. sed -e "s@^\(TK_SRC_DIR='\).*@\1/usr/include'@" \
  70. -e "/TK_B/s@='\(-L\)\?.*unix@='\1/usr/lib${libSuffix}@" \
  71. -i tkConfig.sh
  72. make -j${jobs} DESTDIR="$destdir" install
  73. make -j${jobs} INSTALL_ROOT="$destdir" install-private-headers
  74. # Make symlink(s) for compatibility
  75. ln -s wish${series_version} "${destdir}/usr/bin/wish"
  76. ln -s libtk${series_version}.so "${destdir}/usr/lib${libSuffix}/libtk.so"
  77. ln -s libtkstub${series_version}.a "${destdir}/usr/lib${libSuffix}/libtkstub.a"
  78. unset -v series_version
  79. cd ..
  80. # Compress info documents deleting index file for the package
  81. if test -d "${destdir}/$infodir"
  82. then
  83. rm -f "${destdir}/${infodir}/dir"
  84. lzip -9 "${destdir}/${infodir}"/*
  85. fi
  86. # Compress and link man pages (if needed)
  87. if test -d "${destdir}/$mandir"
  88. then
  89. (
  90. cd "${destdir}/$mandir"
  91. find . -type f -exec lzip -9 {} +
  92. find . -type l | while read -r file
  93. do
  94. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  95. rm -- "$file"
  96. done
  97. )
  98. fi
  99. # Copy documentation
  100. mkdir -p "${destdir}/$docsdir"
  101. cp -p $docs "${destdir}/$docsdir"
  102. }