1 # Build recipe for emacs.
3 # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>.
4 # Copyright (c) 2020-2022 Matias Fonzo, <selk@dragora.org>.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # Exit immediately on any error
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.xz
29 # srcdir=${program}-${version} # Not needed in major releases
32 fetch=https://ftp.gnu.org/gnu/emacs/$tarname
35 The Emacs text editor.
37 GNU Emacs is an extensible, customizable text editor and more.
38 At its core is an interpreter for Emacs Lisp, a dialect of the
39 Lisp programming language with extensions to support text
43 homepage=https://www.gnu.org/software/emacs/
46 # Source documentation
47 docs="BUGS CONTRIBUTE COPYING ChangeLog* README"
48 docsdir="${docdir}/${program}-${version}"
52 unpack "${tardir}/$tarname"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
59 ./configure CPPFLAGS="$QICPPFLAGS" \
60 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
62 --libdir=/usr/lib${libSuffix} \
70 --with-x-toolkit=gtk3 \
71 --without-libsystemd \
74 --without-compress-install \
75 --build="$(gcc -dumpmachine)"
78 make -j${jobs} DESTDIR="$destdir" install-strip
80 # A world without systemd is a healthy world...
81 rm -rf "${destdir}/usr/lib${libSuffix}/systemd"
82 rmdir "${destdir}/usr/lib${libSuffix}" 2> /dev/null || true
84 # Re-create directory for games
85 mkdir -p "${destdir}/var/games/emacs"
86 chown :games "${destdir}/var/games/emacs"
88 if test -d "${destdir}/$infodir"
90 # Delete index file for the package
91 rm -f "${destdir}/${infodir}/dir"
93 # Compress info documents
94 lzip -9 "${destdir}/${infodir}"/* || true
97 # Compress and link man pages (if needed)
98 if test -d "${destdir}/$mandir"
101 cd "${destdir}/$mandir"
102 find . -type f -exec lzip -9 {} +
103 find . -type l | while read -r file
105 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
112 mkdir -p "${destdir}/$docsdir"
113 cp -p $docs "${destdir}/$docsdir"