recipe 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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=27.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" LDFLAGS="$QILDFLAGS" \
  48. $configure_args \
  49. --libdir=/usr/lib${libSuffix} \
  50. --infodir=$infodir \
  51. --mandir=$mandir \
  52. --docdir=$docdir \
  53. --program-prefix= \
  54. --program-suffix= \
  55. --with-modules \
  56. --with-x \
  57. --with-x-toolkit=gtk3 \
  58. --without-libsystemd \
  59. --without-gconf \
  60. --without-gsettings \
  61. --without-compress-install \
  62. --build="$(gcc -dumpmachine)"
  63. make -j${jobs} V=1
  64. make -j${jobs} DESTDIR="$destdir" install-strip
  65. # A world without systemd is a healthy world...
  66. rm -rf "${destdir}/usr/lib${libSuffix}/systemd"
  67. rmdir "${destdir}/usr/lib${libSuffix}" 2> /dev/null || true
  68. # Re-create directory for games
  69. mkdir -p "${destdir}/var/games/emacs"
  70. chown :games "${destdir}/var/games/emacs"
  71. if test -d "${destdir}/$infodir"
  72. then
  73. # Delete index file for the package
  74. rm -f "${destdir}/${infodir}/dir"
  75. # Compress info documents
  76. lzip -9 "${destdir}/${infodir}"/* || true
  77. fi
  78. # Compress and link man pages (if needed)
  79. if test -d "${destdir}/$mandir"
  80. then
  81. (
  82. cd "${destdir}/$mandir"
  83. find . -type f -exec lzip -9 {} +
  84. find . -type l | while read -r file
  85. do
  86. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  87. rm -- "$file"
  88. done
  89. )
  90. fi
  91. # Copy documentation
  92. mkdir -p "${destdir}/$docsdir"
  93. cp -p $docs "${destdir}/$docsdir"
  94. }