1 # Build recipe for emacs.
3 # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>.
4 # Copyright (c) 2020-2021 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.gz
29 # srcdir=${program}-${version} # Not needed in major releases
32 fetch=http://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=http://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" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
61 --libdir=/usr/lib${libSuffix} \
69 --with-x-toolkit=gtk3 \
70 --without-libsystemd \
73 --without-compress-install \
74 --build="$(gcc -dumpmachine)"
77 make -j${jobs} DESTDIR="$destdir" install-strip
79 # A world without systemd is a healthy world...
80 rm -rf "${destdir}/usr/lib${libSuffix}/systemd"
81 rmdir "${destdir}/usr/lib${libSuffix}" 2> /dev/null || true
83 # Re-create directory for games
84 mkdir -p "${destdir}/var/games/emacs"
85 chown :games "${destdir}/var/games/emacs"
87 if test -d "${destdir}/$infodir"
89 # Delete index file for the package
90 rm -f "${destdir}/${infodir}/dir"
92 # Compress info documents
93 lzip -9 "${destdir}/${infodir}"/* || true
96 # Compress and link man pages (if needed)
97 if test -d "${destdir}/$mandir"
100 cd "${destdir}/$mandir"
101 find . -type f -exec lzip -9 {} +
102 find . -type l | while read -r file
104 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
111 mkdir -p "${destdir}${docsdir}"
112 cp -p $docs "${destdir}${docsdir}"