Files
haikuports/app-editors/emacs/emacs-25.3.recipe
2017-10-26 15:34:30 +02:00

147 lines
3.6 KiB
Bash

SUMMARY="The famous text editor"
DESCRIPTION="An extensible, customizable, free/libre text editor — and more.
At its core is an interpreter for Emacs Lisp, a dialect of the Lisp \
programming language with extensions to support text editing.
* Content-aware editing modes, including syntax coloring, for many file types.
* Complete built-in documentation, including a tutorial for new users.
* Full Unicode support for nearly all human scripts.
* Highly customizable, using Emacs Lisp code or a graphical interface.
* An entire ecosystem of functionality beyond text editing, including a \
project planner, mail and news reader, debugger interface, calendar, and more.
* A packaging system for downloading and installing extensions."
HOMEPAGE="https://gnu.org/s/emacs/"
COPYRIGHT="2001-2017 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="http://www.artfiles.org/gnu.org/emacs/emacs-$portVersion.tar.xz"
CHECKSUM_SHA256="253ac5e7075e594549b83fd9ec116a9dc37294d415e2f21f8ee109829307c00b"
PATCHES="emacs-$portVersion.patchset"
ADDITIONAL_FILES="emacs.rdef.in"
ARCHITECTURES="?x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
emacs$secondaryArchSuffix = $portVersion
cmd:ctags.emacs = $portVersion
cmd:ebrowse = $portVersion
cmd:emacs = $portVersion
cmd:emacs_$portVersion
cmd:emacsclient = $portVersion
cmd:etags = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libgnutls$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
# lib:libpng$secondaryArchSuffix
# lib:libjpeg$secondaryArchSuffix
# lib:libtiff$secondaryArchSuffix
# lib:libxpm$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libiconv$secondaryArchSuffix
devel:libgnutls$secondaryArchSuffix
devel:libncurses$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
devel:libz$secondaryArchSuffix >= 1.2.8
# devel:libpng$secondaryArchSuffix
# devel:libjpeg$secondaryArchSuffix
# devel:libtiff$secondaryArchSuffix
# devel:libxpm$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:autoconf
cmd:aclocal
cmd:gcc$secondaryArchSuffix
cmd:find
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:tar
cmd:which
cmd:makeinfo
"
GLOBAL_WRITABLE_FILES="
var/games/emacs/snake-scores keep-old
var/games/emacs/tetris-scores keep-old
"
PATCH()
{
# Hard link not supported on BFS.
sed -i 's/ln -f/ln -s/g' src/Makefile.in
# mmaloc temporary fix.
sed -i 's/emacs_cv_sanitize_address=no/emacs_cv_sanitize_address=yes/g' configure.ac
}
BUILD()
{
export LDFLAGS="-lnetwork -lbsd"
CFLAGS="-D_BSD_SOURCE"
export HOME=/boot/home
autoreconf -fi
runConfigure ./configure \
CANNOT_DUMP=yes # known bug in emacs
make clean
# known bug in emacs
mkdir -p $dataDir/emacs/$portVersion/lisp
cp -R lisp/* $dataDir/emacs/$portVersion/lisp
make $jobArgs
}
INSTALL()
{
# Build fix
for f in emacs bootstrap-emacs; do
rm -rf src/$f
done
make install
# ctags fix
mv $binDir/ctags $binDir/ctags.emacs
# Cleanup
strip $binDir/*
find $dataDir -type f -name "*.el.gz" -delete
for f in appdata applications icons; do
rm -rf $dataDir/$f
done
# Extra attribs
for f in $binDir/*; do
if [ -r "$f" ]; then
addattr SYS:ENV DISABLE_ASLR=1 $f
fi
done
# Icon
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
#local MINOR="`echo "$portVersion" | cut -d. -f3`"
local MINOR="`echo 0`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
$portDir/additional-files/emacs.rdef.in > emacs.rdef
addResourcesToBinaries emacs.rdef \
$binDir/emacs
}