1 # Build recipe for emacs.
3 # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>.
4 # Copyright (c) 2020 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.
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/x-apps"
25 tarname=${program}-${version}.tar.gz
26 # srcdir=${program}-${version} # Not needed in major releases
29 fetch=http://ftp.gnu.org/gnu/emacs/$tarname
32 The Emacs text editor.
34 GNU Emacs is an extensible, customizable text editor and more.
35 At its core is an interpreter for Emacs Lisp, a dialect of the
36 Lisp programming language with extensions to support text
40 homepage=http://www.gnu.org/software/emacs/
43 # Source documentation
44 docs="BUGS CONTRIBUTE COPYING ChangeLog* README"
45 docsdir="${docdir}/${program}-${version}"
51 unpack "${tardir}/$tarname"
55 # Set sane permissions
56 chmod -R u+w,go-w,a+rX-s .
58 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
60 --libdir=/usr/lib${libSuffix} \
68 --with-x-toolkit=gtk3 \
69 --without-libsystemd \
72 --without-compress-install \
73 --build="$(cc -dumpmachine)"
76 make -j${jobs} DESTDIR="$destdir" install-strip
78 # A world without systemd is a healthy world...
79 rm -rf "${destdir}/usr/lib${libSuffix}/systemd"
80 rmdir "${destdir}/usr/lib${libSuffix}" 2> /dev/null || true
82 # Re-create directory for games
83 mkdir -p "${destdir}/var/games/emacs"
84 chown :games "${destdir}/var/games/emacs"
86 if test -d "${destdir}/$infodir"
88 # Delete index file for the package
89 rm -f "${destdir}/${infodir}/dir"
91 # Compress info documents
92 lzip -9 "${destdir}/${infodir}"/* || true
95 # Compress and link man pages (if needed)
96 if test -d "${destdir}/$mandir"
99 cd "${destdir}/$mandir"
100 find . -type f -exec lzip -9 '{}' +
101 find . -type l | while read -r file
103 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
110 mkdir -p "${destdir}${docsdir}"
111 cp -p $docs "${destdir}${docsdir}"