blob: e137cf6e938d9d34cb7230f62a6873d6563da27d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# Maintainer (Arch): Juergen Hoetzel <juergen@archlinux.org>
# Contributor (Arch): Renchi Raju <renchi@green.tam.uiuc.edu>
# Maintainer: André Silva <emulatorman@hyperbola.info>
# Contributor: Jesús E. <heckyel@hyperbola.info>
# Contributor: Tobias Dausend <throgh@hyperbola.info>
pkgname=emacs
pkgver=30.1
_debver=$pkgver
_debrel=5
pkgrel=5
pkgdesc="The extensible, customizable, self-documenting real-time display editor"
arch=('i686' 'x86_64')
url='https://www.gnu.org/software/emacs/emacs.html'
license=('GPL-3')
depends=('librsvg-legacy' 'gpm' 'giflib' 'libxpm' 'libotf' 'm17n-lib' 'gtk' 'hicolor-icon-theme'
'desktop-file-utils' 'alsa-lib' 'gnutls' 'jansson' 'libgccjit' 'libisl')
makedepends=('quilt')
source=("https://ftp.gnu.org/gnu/emacs/${pkgname}-${pkgver}.tar.xz"
"https://deb.debian.org/debian/pool/main/e/emacs/emacs_${_debver}+1-${_debrel}~bpo12+1.debian.tar.xz"
fix-compile.patch::https://github.com/emacs-mirror/emacs/commit/53a5dada413662389a17c551a00d215e51f5049f.patch
"modify-startup.patch")
sha512sums=('511a6a1d2a170a207913692e1349344b70a0b5202b8d1ae27dc7256e589c77ae9e35da16fc2a098bf9f1b8d0f60233f452ed8d6744b70b907f3484c42f2d7d7f'
'55c6ac00a32f8ad0fba530d455916f349775607a3d071e33adccd9ae415511860057b890fcae4670b55f516cdbeb66865d1a2b0f41e678d74b7b635250093f26'
'26f50a28ff6d913681d95e890a42aa50258d98c9c314d9984203e6e2fd1daf9c67d2475bca25b76e9e97cd085a82dc3dbdecbba9ec08fa61945c87511efb2dc3'
'223c8992b730678ea67edda8b8a92e779e96cbf9f41b2cb0fc70029ded6bfbedfbebf90f19af6f9a17c9dd16564aa3b6b97623cec8e1d55ead3a3438efbb8250')
prepare() {
patch -d ${pkgname}-${pkgver} -Np1 < fix-compile.patch
cd "$srcdir"/$pkgname-$pkgver
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
# Doesn't apply
rm -v debian/patches/0001-Prefer-usr-share-info-emacs.patch || true
rm -v debian/patches/0002-Run-debian-startup-and-set-debian-emacs-flavor.patch || true
rm -v debian/patches/0003-Remove-files-that-appear-to-be-incompatible-with-the.patch || true
rm -v debian/patches/0004-Adjust-documentation-references-for-Debian.patch || true
rm -v debian/patches/0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch || true
rm -v debian/patches/0008-Mark-vc-bzr-test-fauilt-bzr-autoloads-as-unstable-fo.patch || true
rm -v debian/patches/0018-Fix-eldoc-warning-in-patch-adding-debian-emacs-flavo.patch || true
quilt push -av
fi
# patchout startup-links
rm lisp/startup.elc
patch -Np1 -i ${srcdir}/modify-startup.patch
}
build() {
cd "$srcdir"/$pkgname-$pkgver
ac_cv_lib_gif_EGifPutExtensionLast=yes
CFLAGS="-O3 -march=native" ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-x-toolkit=gtk \
--with-modules \
--with-json \
--without-dbus \
--without-libsystemd \
--without-tiff \
--without-xft \
--without-sound \
--without-toolkit-scroll-bars \
--with-tree-sitter=ifavailable \
--with-native-compilation=no \
--without-xaw3d
make ${MAKEFLAGS}
# --without-imagemagick \
# --without-compress \
}
package() {
cd "$srcdir"/$pkgname-$pkgver
make ${MAKEFLAGS} DESTDIR="$pkgdir" install
# remove conflict with ctags package
mv "$pkgdir"/usr/bin/{ctags,ctags.emacs}
mv "$pkgdir"/usr/share/man/man1/{ctags.1.gz,ctags.emacs.1}
# remove systemd-related data
rm -rf "$pkgdir"/usr/lib
rm "$pkgdir"/usr/share/emacs/$pkgver/etc/emacs.service
# remove internal package-manager for emacs
# we do not support such as of being a high risk to endanger user-freedom
rm "$pkgdir"/usr/share/emacs/$pkgver/etc/package-keyring.gpg
rm "$pkgdir"/usr/share/emacs/$pkgver/lisp/emacs-lisp/{package,package-vc,package-x}.el.gz
rm "$pkgdir"/usr/share/emacs/$pkgver/lisp/emacs-lisp/{package,package-vc,package-x}.elc
# fix user/root permissions on usr/share files
find "$pkgdir"/usr/share/emacs/$pkgver -exec chown root:root {} \;
install -Dm644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname"
}
|