Christoph Reiter 38126d763e makedepend on autotools for packages using configure
In some cases this will introduce cycles which could likely be cleaned
up by only depending on some unix tools instead of the whole autotools.

Rebuilding doesn't make much sense at this point since it just adds a subset
of base-devel which is still installed by default.
2021-12-12 14:20:50 +01:00

66 lines
2.0 KiB
Bash

# Maintainer: Ricky <rickleaf.wu@gmail.com>
pkgname=emacs
pkgver=27.2
pkgrel=1
pkgdesc="The extensible, customizable, self-documenting, real-time display editor (msys2)"
url="https://www.gnu.org/software/${pkgname}/"
license=('GPL3')
arch=('i686' 'x86_64')
depends=('ncurses' 'zlib' 'libxml2' 'libiconv' 'libcrypt' 'libgnutls' 'glib2' 'libhogweed')
groups=('editors')
makedepends=('gawk' 'libiconv-devel' 'libxml2-devel' 'libiconv-devel' 'ncurses-devel' 'libcrypt-devel' 'libgnutls-devel' 'libunistring-devel' 'autotools')
options=('strip')
source=("https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz"{,.sig}
'configure.ac.diff')
sha256sums=('b4a7cc4e78e63f378624e0919215b910af5bb2a0afc819fad298272e9f40c1b9'
'SKIP'
'0cb204f2cab4740d27a47a4adc7e4168d6034e86cd522605a85bbd03fb1db59d')
validpgpkeys=('E6C9029C363AD41D787A8EBB91C1262F01EB8D39' # Eli Zaretskii (eliz) <eliz@gnu.org>
'28D3BED851FDF3AB57FEF93C233587A47C207910') # Nicolas Petton <nicolas@petton.fr>
prepare() {
cd "${pkgname}-${pkgver}"
patch --binary --forward -p0 < "${srcdir}/configure.ac.diff"
./autogen.sh
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
CPPFLAGS="-DNDEBUG"
CFLAGS="-pipe -O3 -fomit-frame-pointer -funroll-loops"
LDFLAGS="-s -Wl,-s"
./configure \
--prefix=/usr \
--build="${CHOST}" \
--with-x-toolkit=no \
--with-sound=yes \
--with-modules \
--without-compress-install
make
}
package() {
cd "${srcdir}"/${pkgname}-${pkgver}
make DESTDIR="${pkgdir}" install
mv "${pkgdir}/usr/bin/ctags.exe" \
"${pkgdir}/usr/bin/ctags-emacs.exe"
mv "${pkgdir}/usr/share/man/man1/ctags.1" \
"${pkgdir}/usr/share/man/man1/ctags-emacs.1"
rm -f "${pkgdir}/usr/share/info/info.info.gz"
local dir="${pkgdir}/usr/share/${pkgname}"
dir="${dir}/$(ls -1 ${dir} | grep -E '([0-9]+\.[0-9]+)(\.[0-9]+)?')/src"
mkdir -p "${dir}"
cd "${srcdir}/${pkgname}-${pkgver}/src"
cp *.c *.h *.m "${dir}"
}
# TODO:
# Patch `shell-file-name' default in the C source code similarly to
# `source-directory'.