recipe 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Build recipe for emacs.
  2. #
  3. # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>.
  4. # Copyright (c) 2020-2022 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=emacs
  20. version=28.2
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=x-apps
  24. tarname=${program}-${version}.tar.xz
  25. # srcdir=${program}-${version} # Not needed in major releases
  26. # Remote source(s)
  27. fetch=https://ftp.gnu.org/gnu/emacs/$tarname
  28. description="
  29. The Emacs text editor.
  30. GNU Emacs is an extensible, customizable text editor and more.
  31. At its core is an interpreter for Emacs Lisp, a dialect of the
  32. Lisp programming language with extensions to support text
  33. editing.
  34. "
  35. homepage=https://www.gnu.org/software/emacs/
  36. license="GPLv3+"
  37. # Source documentation
  38. docs="BUGS CONTRIBUTE COPYING ChangeLog* README"
  39. docsdir="${docdir}/${program}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. ./configure CPPFLAGS="$QICPPFLAGS" \
  47. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
  48. LDFLAGS="$QILDFLAGS" \
  49. $configure_args \
  50. --libdir=/usr/lib${libSuffix} \
  51. --infodir=$infodir \
  52. --mandir=$mandir \
  53. --docdir=$docdir \
  54. --program-prefix= \
  55. --program-suffix= \
  56. --with-modules \
  57. --with-x \
  58. --with-x-toolkit=gtk3 \
  59. --without-dbus \
  60. --without-libsystemd \
  61. --without-gconf \
  62. --without-gsettings \
  63. --without-compress-install \
  64. --build="$(gcc -dumpmachine)"
  65. make -j${jobs} V=1
  66. make -j${jobs} DESTDIR="$destdir" install-strip
  67. # A world without systemd is a healthy world...
  68. rm -rf "${destdir}/usr/lib${libSuffix}/systemd"
  69. rmdir "${destdir}/usr/lib${libSuffix}" 2> /dev/null || true
  70. # Re-create directory for games
  71. mkdir -p "${destdir}/var/games/emacs"
  72. chown :games "${destdir}/var/games/emacs"
  73. if test -d "${destdir}/$infodir"
  74. then
  75. # Delete index file for the package
  76. rm -f "${destdir}/${infodir}/dir"
  77. # Compress info documents
  78. lzip -9 "${destdir}/${infodir}"/* || true
  79. fi
  80. # Compress and link man pages (if needed)
  81. if test -d "${destdir}/$mandir"
  82. then
  83. (
  84. cd "${destdir}/$mandir"
  85. find . -type f -exec lzip -9 {} +
  86. find . -type l | while read -r file
  87. do
  88. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  89. rm -- "$file"
  90. done
  91. )
  92. fi
  93. # Copy documentation
  94. mkdir -p "${destdir}/$docsdir"
  95. cp -p $docs "${destdir}/$docsdir"
  96. }