Files
haikuports/app-editors/emacs/emacs-26.2.recipe
waddlesplash 4f180bdb94 Utilize the new "all" ARCHITECTURES keyword in most recipes. (#6189)
x86_64 is used as a baseline: the "x86_64" entry, whatever status it has,
is transformed into "all", and then the other entries in ARCHITECTURES
either dropped or rearranged appropriately.
2021-09-15 15:40:18 -04:00

139 lines
3.7 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-2019 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="151ce69dbe5b809d4492ffae4a4b153b2778459de6deb26f35691e1281a9c58e"
PATCHES="emacs-$portVersion.patchset"
ADDITIONAL_FILES="emacs.rdef.in"
ARCHITECTURES="all ?x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
emacs$secondaryArchSuffix = $portVersion
cmd:ctags.emacs$commandSuffix = $portVersion
cmd:ebrowse$commandSuffix = $portVersion
cmd:emacs$commandSuffix = $portVersion
cmd:emacs_$portVersion$commandSuffix = $portVersion
cmd:emacsclient$commandSuffix = $portVersion
cmd:etags$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libexecinfo$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libgnutls$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libexecinfo$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libgnutls$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libncurses$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:makeinfo
cmd:pkg_config$secondaryArchSuffix
cmd:tar
cmd:which
"
defineDebugInfoPackage emacs$secondaryArchSuffix \
$commandBinDir/ctags.emacs \
$commandBinDir/emacs-$portVersion \
$commandBinDir/emacsclient \
$commandBinDir/etags
PATCH()
{
# Hard links not supported on BFS.
sed -i 's/ln -f/ln -s/g' src/Makefile.in
}
BUILD()
{
export LDFLAGS="-lnetwork -lbsd"
CFLAGS="-D_BSD_SOURCE"
export HOME=/boot/home
autoreconf -fi
runConfigure --omit-dirs "binDir sbinDir" ./configure \
--bindir "$commandBinDir" \
--sbindir="$commandBinDir" \
--with-modules \
CANNOT_DUMP=yes # known bug in emacs
make $jobArgs
}
INSTALL()
{
# Install fix, emacs is stupid
for f in emacs bootstrap-emacs; do
rm -rf src/$f
done
make install
# ctags fix
mv $commandBinDir/ctags $commandBinDir/ctags.emacs
# Cleanup
for f in appdata applications icons; do
rm -rf $dataDir/$f
done
rm -rf $libDir/systemd
# 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 \
$commandBinDir/emacs
}