# Template file for 'emacs' pkgname=emacs version=29.4 revision=2 create_wrksrc=required build_style=gnu-configure configure_args="--with-file-notification=inotify --with-modules $(vopt_with jpeg) $(vopt_with tiff) $(vopt_with gif) $(vopt_with png) $(vopt_with webp) $(vopt_with xpm) $(vopt_with svg rsvg) $(vopt_with imagemagick) $(vopt_with xml xml2) $(vopt_with gnutls) $(vopt_with sound) $(vopt_with m17n m17n-flt) $(vopt_with json) $(vopt_with harfbuzz) $(vopt_with cairo) $(vopt_with gmp libgmp) $(vopt_with sqlite sqlite3) $(vopt_with treesitter tree-sitter) $(vopt_with nativecomp native-compilation=aot)" hostmakedepends="pkg-config tar texinfo" makedepends="ncurses-devel libXaw-devel libXi-devel gtk+3-devel libwebkit2gtk41-devel dbus-devel acl-devel $(vopt_if jpeg libjpeg-turbo-devel) $(vopt_if tiff tiff-devel) $(vopt_if gif giflib-devel) $(vopt_if png libpng-devel) $(vopt_if webp libwebp-devel) $(vopt_if xpm libXpm-devel) $(vopt_if svg librsvg-devel) $(vopt_if imagemagick libmagick-devel) $(vopt_if xml libxml2-devel) $(vopt_if gnutls gnutls-devel) $(vopt_if sound alsa-lib-devel) $(vopt_if m17n m17n-lib-devel) $(vopt_if json jansson-devel) $(vopt_if harfbuzz harfbuzz-devel) $(vopt_if cairo cairo-devel) $(vopt_if gmp gmp-devel) $(vopt_if treesitter tree-sitter-devel) $(vopt_if sqlite sqlite-devel) $(vopt_if nativecomp libgccjit-devel)" depends="emacs-common-${version}_${revision}" short_desc="GNU Emacs editor" maintainer="Leah Neukirchen " license="GPL-3.0-or-later" homepage="http://www.gnu.org/software/emacs/" changelog="https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases" distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz" checksum=ba897946f94c36600a7e7bb3501d27aa4112d791bfe1445c61ed28550daca235 nocross=yes nopie=yes # Package build options build_options="cairo dbus gif gmp gnutls harfbuzz imagemagick jpeg json m17n nativecomp png sound sqlite svg tiff treesitter webp xml xpm" desc_option_cairo="Enable support for drawing with Cairo" desc_option_gmp="Enable support for big numbers using GMP" desc_option_json="Enable support for native JSON parsing" desc_option_m17n="Enable support for m17n multilingual text processing" desc_option_nativecomp="Enable support for native compilation" desc_option_sound="Enable support for sound" desc_option_sqlite="Enable support for SQLite3" desc_option_treesitter="Enable support for tree-sitter parsers" desc_option_webp="Enable support for WebP format" desc_option_xpm="Enable support for XPM images" build_options_default="cairo gif gmp gnutls harfbuzz jpeg json m17n nativecomp png sound sqlite svg tiff treesitter webp xml xpm" post_extract() { # Just configuring in different directories results in # spurious emacs rebuilds with incompatible build numbers. cp -a emacs-* nox cp -a emacs-* x11 cp -a emacs-* gtk3 cp -a emacs-* pgtk } do_configure() { cd $wrksrc/nox ./configure --without-x $(vopt_with dbus) ${configure_args} \ --without-native-compilation cd $wrksrc/x11 ./configure --with-x-toolkit=athena --without-toolkit-scroll-bars \ $(vopt_with dbus) --without-gconf --without-gsettings \ ${configure_args} cd $wrksrc/gtk3 ./configure --with-x-toolkit=gtk3 --with-xwidgets ${configure_args} cd $wrksrc/pgtk ./configure --with-pgtk ${configure_args} } do_build() { make ${makejobs} -C nox V=1 make ${makejobs} -C x11 make ${makejobs} -C gtk3 make ${makejobs} -C pgtk } do_install() { make DESTDIR=$DESTDIR -C ${wrksrc}/nox install rm -f ${DESTDIR}/usr/bin/ctags rm -f ${DESTDIR}/usr/lib/systemd/user/emacs.service rm -f ${DESTDIR}/usr/share/man/man1/ctags.1* rm -f ${DESTDIR}/usr/share/info/info.info rm -rf ${DESTDIR}/usr/share/applications rm -rf ${DESTDIR}/usr/share/icons } emacs-common_package() { short_desc+=" - common files" replaces="emacs-common-eln>=0" pkg_install() { vmove usr/share/emacs vmove usr/share/man vmove usr/share/info rm -f ${PKGDESTDIR}/usr/share/info/info.info.gz } } emacs-x11_package() { depends="emacs-common-${version}_${revision}" provides="emacs-${version}_${revision}" replaces="emacs>=0" short_desc+=" - X11 version" pkg_install() { make DESTDIR=${PKGDESTDIR} -C ${wrksrc}/x11 install rm -f ${PKGDESTDIR}/usr/bin/ctags rm -rf ${PKGDESTDIR}/usr/share rm -rf ${PKGDESTDIR}/usr/lib/systemd } } emacs-gtk3_package() { depends="emacs-common-${version}_${revision} desktop-file-utils hicolor-icon-theme" provides="emacs-${version}_${revision}" replaces="emacs>=0" short_desc+=" - GTK+3 version" pkg_install() { make DESTDIR=${PKGDESTDIR} -C ${wrksrc}/gtk3 install rm -f ${PKGDESTDIR}/usr/bin/ctags rm -rf ${PKGDESTDIR}/usr/share/{emacs,man,info} rm -rf ${PKGDESTDIR}/usr/lib/systemd } } emacs-pgtk_package() { depends="emacs-common-${version}_${revision} desktop-file-utils hicolor-icon-theme" provides="emacs-${version}_${revision}" replaces="emacs>=0" short_desc+=" - Pure GTK version" pkg_install() { make DESTDIR=${PKGDESTDIR} -C ${wrksrc}/pgtk install rm -f ${PKGDESTDIR}/usr/bin/ctags rm -rf ${PKGDESTDIR}/usr/share/{emacs,man,info} rm -rf ${PKGDESTDIR}/usr/lib/systemd } }