[Emacs, AUR] Update and add Emacs PKGBUILD, upgrade org-mode

This commit rebases my Emacs PKGBUILD on the one used by
`emacs-git'. By default, my compiler will now use the gold linker,
native-compilation, and ahead of time elisp native compilation. It
stills include PDF documentation and xwidgets browser, but removes the
HTML docs.

Recently, the `contrib/' directory of org moved to a different
repository. This broke the previous `emacs-org-mode-git' package. This
commit adds a new PKGBUILD for `emacs-org-mode-git' and adds a
configuration snippet for `org-contrib' in my vanilla Emacs
configuration.
This commit is contained in:
Lucien Cartier-Tilet 2021-05-21 20:37:01 +02:00
parent f2502b016a
commit 1147c993ee
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
4 changed files with 187 additions and 101 deletions

View File

@ -1,16 +1,5 @@
# Maintainer: Andrew Whatson <https://aur.archlinux.org/account/flatwhatson> # Maintainer: Pedro A. López-Valencia <https://aur.archlinux.org/users/vorbote>
# Maintainer of emacs-git: Pedro A. López-Valencia <https://aur.archlinux.org/users/vorbote> # Maintainer of emacs-phundrak-git: Lucien Cartier-Tilet <https://aur.archlinux.org/users/phundrak>
################################################################################
# The difference between this PKGBUILD and the one from `emacs-git` is that:
# - this one builds emacs from `feature/native-comp` branch.
# - built-in packages are native compiled by default.
# - link-time optimization is disabled by default.
#
# Pre-compiling all built-in elisp modules takes *hours* on fast systems. You
# can set FAST_BOOT="YES" to pre-compile the bare minimum, then you'll need to
# manage native-compilation later (eg. with comp-deferred-compilation).
################################################################################
################################################################################ ################################################################################
# CAVEAT LECTOR: This PKGBUILD is highly opinionated. I give you # CAVEAT LECTOR: This PKGBUILD is highly opinionated. I give you
@ -25,7 +14,7 @@
################################################################################ ################################################################################
################################################################################ ################################################################################
# Assign "YES" to the variable you want enabled; empty or other value # Assign "YES" to the variable you want enabled; empty or any other value
# for NO. # for NO.
# #
# Where you read experimental, replace with foobar. # Where you read experimental, replace with foobar.
@ -33,10 +22,17 @@
# #
################################################################################ ################################################################################
CHECK= # Run tests. May fail, this is developement after all. CHECK= # Run tests. May fail, this is developement after all.
CLANG="NO" # Use clang. CLANG= # Use clang.
LTO="YES" # Enable link-time optimization. Not that experimental anymore. GOLD="YES" # Use the gold linker.
# Seems fixed in GCC, so I've reenabled binutils support, please LTO="YES" # Enable link-time optimization. Read emacs's INSTALL before
# report any bug, to make it use clang by default again. # attempting to use it with clang.
JIT="YES" # Enable native just-in-time compilation. libgccjit is in AUR.
# This compiles only performance critical elisp files.
# To compile all elisp on demand, set
# comp-deferred-compilation non-nil
AOT="YES" # Precompile all included elisp. It takes a long time.
# You still need to enable on-demand compilation
# for your own packages.
CLI= # CLI only binary. CLI= # CLI only binary.
NOTKIT= # Use no toolkit widgets. Like B&W Twm (001d sk00l). NOTKIT= # Use no toolkit widgets. Like B&W Twm (001d sk00l).
LUCID= # Use the lucid, a.k.a athena, toolkit. Like XEmacs, sorta. LUCID= # Use the lucid, a.k.a athena, toolkit. Like XEmacs, sorta.
@ -48,63 +44,55 @@ LUCID= # Use the lucid, a.k.a athena, toolkit. Like XEmacs, sorta.
# Xft, if you choose no toolkit or Lucid. # Xft, if you choose no toolkit or Lucid.
# #
GTK2= # GTK2 support. Why would you? GTK2= # GTK2 support. Why would you?
M17N= # Enable m17n international table input support. NOCAIRO= # Disable here.
# You are far better off using harfbuzz+freetype2
# But this gives independence if you need it.
# In fact, right now harfbuzz is hardwired, I have to
# be convinced it should be refactored.
CAIRO="YES" # GOOD NEWS! No longer experimental and fully supported.
# This is now, along with harfbuzz, the prefered font
# and text shaping engine.
# If using GTK+, you'll get printing for free.
XWIDGETS="YES" # Use GTK+ widgets pulled from webkit2gtk. Usable. XWIDGETS="YES" # Use GTK+ widgets pulled from webkit2gtk. Usable.
DOCS_HTML= # Generate and install html documentation. DOCS_HTML= # Generate and install html documentation.
DOCS_PDF="YES" # Generate and install pdf documentation. DOCS_PDF="YES" # Generate and install pdf documentation.
MAGICK= # ImageMagick 7 support. Deprecated (read the logs). MAGICK= # ImageMagick 7 support. Deprecated (read the logs).
# ImageMagick, like flash, is a bug ridden pest that # ImageMagick, like flash, won't die...
# won't die; yet it is useful if you know what you # -->>If you just *believe* you need ImageMagick, you don't.<<--
# are doing. NOGZ="YES" # Don't compress .el files.
# -->>If you just *believe* you need it, you don't.<<--
PDUMPER="YES" # Enable pdumper support unconditionally
NOGZ= # Don't compress .el files.
FAST_BOOT= # Only native-compile the bare minimum. Intended for use with
# deferred compilation to native-compile on-demand at runtime.
PROFILING= # Enable gprof profiling support.
################################################################################ ################################################################################
################################################################################ ################################################################################
pkgname="emacs-phundrak-git" if [[ $CLI == "YES" ]] ; then
pkgver=28.0.50.148419 pkgname="emacs-nox-phundrak-git"
else
pkgname="emacs-phundrak-git"
fi
pkgver=28.0.50.148423
pkgrel=1 pkgrel=1
pkgdesc="GNU Emacs. Development native-comp branch. Phundraks tweaks." pkgdesc="GNU Emacs. Development master branch with Phundraks tweaks."
arch=('x86_64' ) arch=('x86_64')
url="http://www.gnu.org/software/emacs/" url="http://www.gnu.org/software/emacs/"
license=('GPL3' ) license=('GPL3')
depends=('alsa-lib' 'gnutls' 'libxml2' 'jansson' 'libotf' 'harfbuzz' 'gpm' 'libgccjit') depends_nox=('alsa-lib' 'gnutls' 'libxml2' 'jansson' 'gpm')
depends=("${depends_nox[@]}" 'm17n-lib' 'libotf' 'harfbuzz')
makedepends=('git') makedepends=('git')
provides=('emacs' 'emacs-seq') provides=('emacs' 'emacs26-git' 'emacs-27-git' 'emacs-seq' 'emacs-nox' 'emacs-git')
conflicts=('emacs' 'emacs26-git' 'emacs-27-git' 'emacs-git' 'emacs-seq' 'emacs-native-comp-git' 'emacs-pgtk-native-comp-git') conflicts=('emacs' 'emacs26-git' 'emacs-27-git' 'emacs-seq' 'emacs-nox' 'emacs-git')
replaces=('emacs26-git' 'emacs27-git' 'emacs-git' 'emacs-seq') replaces=('emacs' 'emacs26-git' 'emacs-27-git' 'emacs-seq' 'emacs-nox' 'emacs-git')
source=("emacs-git::git://git.savannah.gnu.org/emacs.git") source=("emacs-git::git://git.savannah.gnu.org/emacs.git")
# If Savannah fails for reasons, use Github's mirror
#source=("emacs-git::git://github.com/emacs-mirror/emacs.git")
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
md5sums=('SKIP') md5sums=('SKIP')
# If Savannah access is blocked for reasons, use Github instead.
# Edit the config file of your local repo copy as well.
# source=("emacs-git::git://github.com/emacs-mirror/emacs.git#branch=feature/native-comp")
################################################################################ ################################################################################
################################################################################ ################################################################################
CFLAGS+=" -O3 -march=native -mtune=native" CFLAGS+=" -O3 -march=native -mtune=native"
CXXFLAGS+=" -O3 -march=native -mtune=native" CXXFLAGS+=" -O3 -march=native -mtune=native"
if [[ $LTO == "YES" ]]; then if [[ $GOLD == "YES" && ! $CLANG == "YES" ]]; then
CFLAGS+=" -flto" export LD=/usr/bin/ld.gold
CXXFLAGS+=" -flto" export CFLAGS+=" -fuse-ld=gold";
if [[ $CLANG != "YES" ]]; then export CXXFLAGS+=" -fuse-ld=gold";
CFLAGS+=" -fuse-linker-plugin" elif [[ $GOLD == "YES" && $CLANG == "YES" ]]; then
CXXFLAGS+=" -fuse-linker-plugin" echo "";
fi echo "Clang rather uses its own linker.";
echo "";
exit 1;
fi fi
if [[ $CLANG == "YES" ]]; then if [[ $CLANG == "YES" ]]; then
@ -117,38 +105,51 @@ if [[ $CLANG == "YES" ]]; then
export CCFLAGS+=' -fuse-ld=lld' ; export CCFLAGS+=' -fuse-ld=lld' ;
export CXXFLAGS+=' -fuse-ld=lld' ; export CXXFLAGS+=' -fuse-ld=lld' ;
makedepends+=( 'clang' 'lld' 'llvm') ; makedepends+=( 'clang' 'lld' 'llvm') ;
else
export LD="/usr/bin/ld.gold"
export CFLAGS+=" -fuse-ld=gold"
export CXXFLAGS+=" -fuse-ld=gold"
fi fi
if [[ $NOTKIT == "YES" ]]; then if [[ $LTO == "YES" ]]; then
depends+=( 'dbus' 'hicolor-icon-theme' 'libxinerama' 'libxrandr' 'lcms2' 'librsvg' ); if [[ $CLANG != "YES" ]]; then
CFLAGS+=" -flto -fuse-linker-plugin"
CXXFLAGS+=" -flto -fuse-linker-plugin"
else
CFLAGS+=" -flto"
CXXFLAGS+=" -flto"
fi
fi
if [[ $JIT == "YES" ]]; then
if [[ $CLI == "YES" ]]; then
depends_nox+=( 'libgccjit' );
else
depends+=( 'libgccjit' );
fi
fi
if [[ $CLI == "YES" ]]; then
depends=("${depends_nox[@]}");
elif [[ $NOTKIT == "YES" ]]; then
depends+=( 'dbus' 'hicolor-icon-theme' 'libxinerama' 'libxrandr' 'lcms2' 'librsvg' 'libxfixes' );
makedepends+=( 'xorgproto' );
elif [[ $LUCID == "YES" ]]; then elif [[ $LUCID == "YES" ]]; then
depends+=( 'dbus' 'hicolor-icon-theme' 'libxinerama' 'libxfixes' 'lcms2' 'librsvg' 'xaw3d' 'xorgproto' ); depends+=( 'dbus' 'hicolor-icon-theme' 'libxinerama' 'libxfixes' 'lcms2' 'librsvg' 'xaw3d' 'libxrandr' );
makedepends+=( 'xorgproto' ); makedepends+=( 'xorgproto' );
elif [[ $GTK2 == "YES" ]]; then elif [[ $GTK2 == "YES" ]]; then
depends+=( 'gtk2' ); depends+=( 'gtk2' 'lcms2' );
makedepends+=( 'xorgproto' ); makedepends+=( 'xorgproto' );
else else
depends+=( 'gtk3' ); depends+=( 'gtk3' );
makedepends+=( 'xorgproto' ); makedepends+=( 'xorgproto' );
fi fi
if [[ $M17N == "YES" ]]; then
depends+=( 'm17n-lib' );
fi
if [[ $MAGICK == "YES" ]]; then if [[ $MAGICK == "YES" ]]; then
depends+=( 'imagemagick' 'libjpeg-turbo' 'giflib' ); depends+=( 'imagemagick' 'libjpeg-turbo' 'giflib' );
elif [[ ! $NOX == "YES" ]]; then elif [[ ! $NOX == "YES" ]] && [[ ! $CLI == "YES" ]]; then
depends+=( 'libjpeg-turbo' 'giflib' ); depends+=( 'libjpeg-turbo' 'giflib' );
else elif [[ $CLI == "YES" ]]; then
depends+=(); depends+=();
fi fi
if [[ $CAIRO == "YES" ]]; then if [[ ! $NOCAIRO == "YES" ]] && [[ ! $CLI == "YES" ]] ; then
depends+=( 'cairo' ); depends+=( 'cairo' );
fi fi
@ -190,7 +191,7 @@ prepare() {
if [[ $CHECK == "YES" ]]; then if [[ $CHECK == "YES" ]]; then
check() { check() {
cd "$srcdir/emacs-git" cd "$srcdir/emacs-git"
make -j check make check
} }
fi fi
@ -206,7 +207,6 @@ build() {
--with-gameuser=:games --with-gameuser=:games
--with-sound=alsa --with-sound=alsa
--with-modules --with-modules
--with-native-compilation
--with-json --with-json
# Beware https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25228 # Beware https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25228
# dconf and gconf break font settings you set in ~/.emacs. # dconf and gconf break font settings you set in ~/.emacs.
@ -228,12 +228,12 @@ if [[ $LTO == "YES" ]]; then
_conf+=( '--enable-link-time-optimization' ); _conf+=( '--enable-link-time-optimization' );
fi fi
if [[ $PROFILING == "YES" ]]; then if [[ $JIT == "YES" ]]; then
_conf+=( '--enable-profiling' ); _conf+=( '--with-native-compilation' );
fi fi
if [[ $CLI == "YES" ]]; then if [[ $CLI == "YES" ]]; then
_conf+=( '--without-x' '--with-x-toolkit=no' '--without-xft' '--without-lcms2' '--without-rsvg' ); _conf+=( '--without-x' '--with-x-toolkit=no' '--without-xft' '--without-lcms2' '--without-rsvg' '--without-jpeg' '--without-gif' '--without-tiff' '--without-png' );
elif [[ $NOTKIT == "YES" ]]; then elif [[ $NOTKIT == "YES" ]]; then
_conf+=( '--with-x-toolkit=no' '--without-toolkit-scroll-bars' '--with-xft' '--without-xaw3d' ); _conf+=( '--with-x-toolkit=no' '--without-toolkit-scroll-bars' '--with-xft' '--without-xaw3d' );
elif [[ $LUCID == "YES" ]]; then elif [[ $LUCID == "YES" ]]; then
@ -244,30 +244,27 @@ else
_conf+=( '--with-x-toolkit=gtk3' '--without-xaw3d' ); _conf+=( '--with-x-toolkit=gtk3' '--without-xaw3d' );
fi fi
if [[ ! $M17N == "YES" ]]; then
_conf+=( '--without-m17n-flt' );
fi
if [[ $MAGICK == "YES" ]]; then if [[ $MAGICK == "YES" ]]; then
_conf+=( '--with-imagemagick'); _conf+=( '--with-imagemagick');
else
_conf+=();
fi fi
if [[ $CAIRO == "YES" ]]; then if [[ $NOCAIRO == "YES" || $CLI == "YES" ]]; then
_conf+=( '--with-cairo' ); _conf+=( '--without-cairo' );
fi fi
if [[ $XWIDGETS == "YES" ]]; then if [[ $XWIDGETS == "YES" ]]; then
_conf+=( '--with-xwidgets' ); _conf+=( '--with-xwidgets' );
fi fi
if [[ $PDUMPER == "YES" ]]; then
_conf+=( '--with-pdumper' );
fi
if [[ $NOGZ == "YES" ]]; then if [[ $NOGZ == "YES" ]]; then
_conf+=( '--without-compress-install' ); _conf+=( '--without-compress-install' );
fi fi
# ctags/etags may be provided by other packages, e.g, universal-ctags
_conf+=('--program-transform-name=s/\([ec]tags\)/\1.emacs/')
################################################################################ ################################################################################
################################################################################ ################################################################################
@ -282,10 +279,10 @@ fi
# Please note that incremental compilation implies that you # Please note that incremental compilation implies that you
# are reusing your src directory! # are reusing your src directory!
# #
if [[ $FAST_BOOT == "YES" ]]; then if [[ $JIT == "YES" ]] && [[ $AOT == "YES" ]]; then
make -j NATIVE_FAST_BOOT=1 make NATIVE_FULL_AOT=1
else else
make -j make
fi fi
# You may need to run this if 'loaddefs.el' files become corrupt. # You may need to run this if 'loaddefs.el' files become corrupt.
@ -312,15 +309,6 @@ package() {
if [[ $DOCS_HTML == "YES" ]]; then make DESTDIR="$pkgdir/" install-html; fi if [[ $DOCS_HTML == "YES" ]]; then make DESTDIR="$pkgdir/" install-html; fi
if [[ $DOCS_PDF == "YES" ]]; then make DESTDIR="$pkgdir/" install-pdf; fi if [[ $DOCS_PDF == "YES" ]]; then make DESTDIR="$pkgdir/" install-pdf; fi
# remove conflict with ctags package
mv "$pkgdir"/usr/bin/{ctags,ctags.emacs}
if [[ $NOGZ == "YES" ]]; then
mv "$pkgdir"/usr/share/man/man1/{ctags.1,ctags.emacs.1};
else
mv "$pkgdir"/usr/share/man/man1/{ctags.1.gz,ctags.emacs.1.gz}
fi
# fix user/root permissions on usr/share files # fix user/root permissions on usr/share files
find "$pkgdir"/usr/share/emacs/ | xargs chown root:root find "$pkgdir"/usr/share/emacs/ | xargs chown root:root

View File

@ -0,0 +1,39 @@
# contributor: zhuqin <zhuqin83@gmail.com>
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
pkgname=emacs-org-mode-git
pkgver=9.4.6.r541.g52b09799c
pkgrel=1
epoch=1
pkgdesc="Emacs Org Mode from git"
arch=('any')
url="http://orgmode.org/"
depends=('emacs')
makedepends=('git' 'texlive-core' 'perl' 'awk')
optdepends=('java-environment: for using ditaa.jar in the contrib directory'
'zsh: for using dir2org.zsh in the contrib directory')
license=('GPL')
provides=("emacs-org-mode=$pkgver")
conflicts=('emacs-org-mode')
install=emacs-org-mode.install
source=(emacs-org-mode::git+https://code.orgmode.org/bzg/org-mode.git)
md5sums=('SKIP')
pkgver() {
cd ${pkgname%-git}
git describe --tags | sed 's+-+.r+' | cut -c9- | tr - .
}
build() {
cd ${pkgname%-git}
make
}
package () {
cd ${pkgname%-git}
make DESTDIR="$pkgdir" install
mkdir -p "$pkgdir"/usr/share/info/orgmode
find "$pkgdir"/usr/share/info -maxdepth 1 -type f -exec mv {} "$pkgdir"/usr/share/info/orgmode \;
install -d "$pkgdir"/usr/share/emacs/site-lisp/org_contrib
}

View File

@ -0,0 +1,44 @@
INFODIR=/usr/share/info
pre_install() {
##! for file in {org,org-?.gz} ; do
##! if [ -e $INFODIR/$file ] ; then
##! echo "Removing $INFODIR/$file"
##! install-info --delete $INFODIR/$file $INFODIR/dir 2> /dev/null
##! rm -f $INFODIR/$file
##! fi
##! done
cat << EOM
To enable this version of org-mode instead of the one shipped with emacs,
add the line:
(require 'org-install)
to your .emacs file.
NOTE: info documentation for emacs-org-mode goes now as 'orgmode' in /usr/share/info,
It does NOT replace the 'org' info files shipped with emacs:
$ info orgmode ## this version
$ info org ## emacs' org version
EOM
}
post_install() {
##! mv $INFODIR/orgmode.gz $INFODIR/org.gz
##! install-info $INFODIR/org.gz $INFODIR/dir 2> /dev/null
##! and comment out the following line:
install-info --name='orgmode' --description='Org Mode provided by emacs-org-mode (AUR)' $INFODIR/orgmode.gz $INFODIR/dir 2> /dev/null
echo "For odt export, define a variable org-odt-data-dir to point "
echo "to an existing directory, e.g."
echo "(defvar org-odt-data-dir \"~/.emacs.d/org/etc\")"
}
post_upgrade() {
post_install
}
pre_remove() {
install-info --delete $INFODIR/orgmode.gz $INFODIR/dir 2> /dev/null
##! comment out the line above and uncomment the following:
##! install-info --delete $INFODIR/org.gz $INFODIR/dir 2> /dev/null
##! rm $INFODIR/org.gz 2> /dev/null
}

View File

@ -1091,8 +1091,6 @@ I like it, so [[https://github.com/Phundrak/eshell-info-banner.el][Ive writte
:init :init
;; (add-hook 'org-mode-hook #'visual-line-mode) ;; (add-hook 'org-mode-hook #'visual-line-mode)
(auto-fill-mode -1) (auto-fill-mode -1)
(require 'ox-extra)
(ox-extras-activate '(ignore-headlines))
:general :general
(:states 'normal (:states 'normal
@ -1249,6 +1247,23 @@ I like it, so [[https://github.com/Phundrak/eshell-info-banner.el][Ive writte
(evil-org-agenda-set-keys)) (evil-org-agenda-set-keys))
#+end_src #+end_src
Since very recently, the ~contrib/lisp/~ directory of org moved out of
the main repository to [[https://git.sr.ht/~bzg/org-contrib][this repository]]. On the other hand,
~contrib/scripts/~ moved to [[https://code.orgmode.org/bzg/worg/src/master/code][the worg repository]], but I dont need
it. The main reason I want ~org-contrib~ is due to ~ox-extra~ that allow
the usage of the ~:ignore:~ tag in org.
#+begin_src emacs-lisp
(use-package org-contrib
:straight (org-contrib
:type git
:host nil
:repo "https://git.sr.ht/~bzg/org-contrib"
:build t)
:init
(require 'ox-extra)
(ox-extras-activate '(latex-header-blocks ignore-headlines)))
#+end_src
**** Agenda **** Agenda
:PROPERTIES: :PROPERTIES:
:header-args:emacs-lisp: :tangle no :exports code :results silent :header-args:emacs-lisp: :tangle no :exports code :results silent
@ -2356,7 +2371,7 @@ Undefining some stuff to make keybind prefixes work correctly.
epa-key-list-mode-map special-mode-map splash-screen-keymap epa-key-list-mode-map special-mode-map splash-screen-keymap
undo-tree-visualizer-mode-map magit-blame-read-only-mode-map undo-tree-visualizer-mode-map magit-blame-read-only-mode-map
org-agenda-keymap org-agenda-mode-map git-rebase-mode-map org-agenda-keymap org-agenda-mode-map git-rebase-mode-map
Buffer-menu-mode-map custom-mode-map) Buffer-menu-mode-map custom-mode-map gfm-view-mode-map)
"SPC" nil) "SPC" nil)
(general-define-key (general-define-key