1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00
freebsd-ports/Mk/Uses/emacs.mk
Yasuhiro Kimura ba4eb3a50e editors/emacs: Update to 29.1
* Update Canna patch to the one for Emacs 29.
* Add new options PGTK, SQLITE3, TREESITTER and WEBP. SQLITE3 and
  TREESITTER are ON by default. PGTK and WEBP options are excluded
  from nox flavor.
* CARGO option doesn't imply XFT but prevents it. It is caused as a
  result of adding pure GTK support (PGTK option).
* OTK options doesn't imply XTF any more. It is also caused as a
  result of adding pure GTK support.
* Update NATIVECOMP option so it specifies ahead-of-time compilation
  via the configure argument.
* Remove "experimental" from NATIVECOMP_DESC.
* Add print/freetype2 and x11-fonts/fontconfig to CAIRO_LIB_DEPENDS
  and GTK3_LIB_DEPENDS. Necessary to link emacs binary with shared
  libraries.
* When PGTK option is ON and SCROLLBARS is OFF, configure fails as
  following

  ----------------------------------------------------------------------
  checking for gnutls >= 2.12.2... yes
  checking for jansson >= 2.7... yes
  checking for tree-sitter >= 0.20.2... yes
  checking for libkqueue... no
  checking for library containing kqueue... none required
  configure: error: Non-toolkit scroll bars are not implemented for your system
  ----------------------------------------------------------------------

  So add SCROLLBARS to PGTK_IMPLIES to avoid such options setting.
* When MODULES option is OFF and TREESITTER is ON, link error happens
  as following.

  ----------------------------------------------------------------------
  cc -o temacs.tmp \
    -Demacs  -I. -I. -I../lib -I../lib   -I/usr/local/include   -I/usr/local/include/librsvg-2.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/gdk-pixbuf-2.0 -pthread -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -D_THREAD_SAFE   -I/usr/local/include/libpng16  -I/usr/local/include/libxml2   -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include  -I/usr/local/include -D_THREAD_SAFE  -I/usr/local/include -D_THREAD_SAFE  -I/usr/local/include -D_THREAD_SAFE   -I/usr/local/include -D_THREAD_SAFE  -I/usr/local/include -I/usr/local/include/webp   -I/usr/local/include  -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -pthread  -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include  -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16  -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include    -MMD -MF deps/.d -MP  -I/usr/local/include   -I/usr/local/include  -I/usr/local/include -I/usr/local/include/p11-kit-1   -I/usr/local/include/cairo -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -D_THREAD_SAFE      -Wno-switch -Wno-pointer-sign -Wno-string-plus-int -Wno-unknown-attributes -Wno-unknown-pragmas -Wno-initializer-overrides -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include    -fstack-protector-strong -L/usr/local/lib  -L/usr/local/lib \
      dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o  dbusbind.o emacs.o keyboard.o macros.o keymap.o sysdep.o bignum.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex-emacs.o undo.o alloc.o pdumper.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o sort.o font.o print.o lread.o  syntax.o  bytecode.o comp.o  process.o gnutls.o callproc.o region-cache.o sound.o timefns.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o lcms.o kqueue.o  profiler.o decompress.o thread.o systhread.o sqlite.o  treesit.o itree.o      xfont.o ftfont.o ftcrfont.o hbfont.o  fontset.o fringe.o image.o xgselect.o json.o     terminfo.o lastfile.o      ../lib/libgnu.a      ../oldXMenu/libXMenu11.a  -ltiff -ljpeg -L/usr/local/lib -lpng16  -lgif  -L/usr/local/lib -lwebpdemux -lwebpdecoder   -lSM -lICE -lX11   -lXrender  -L/usr/local/lib -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo        -lrt -L/usr/local/lib -ldbus-1  -lexecinfo -L/usr/local/lib -lXrandr  -L/usr/local/lib -lXinerama  -L/usr/local/lib -lXfixes  -lXext -lXext -L/usr/local/lib -lxml2   -lutil -L/usr/local/lib -lcairo  -lncurses  -L/usr/local/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl  -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl   -L/usr/local/lib -lfreetype  -L/usr/local/lib -lfontconfig -lfreetype  -L/usr/local/lib -lharfbuzz    -L/usr/local/lib -lgnutls  -lpthread  -L/usr/local/lib -llcms2 -llcms2_fast_float -llcms2_threaded   -lm -lz   -L/usr/local/lib -ljansson  -lgmp  -L/usr/local/lib -lXi   -L/usr/local/lib -ltree-sitter  -lsqlite3 -lXcomposite -lXext
  ld: error: undefined symbol: dynlib_error
  >>> referenced by treesit.c
  >>>               treesit.o:(treesit_load_language)
  >>> referenced by treesit.c
  >>>               treesit.o:(treesit_load_language)
  >>> referenced by treesit.c
  >>>               treesit.o:(treesit_load_language)
  >>> referenced 1 more times

  ld: error: undefined symbol: dynlib_sym
  >>> referenced by treesit.c
  >>>               treesit.o:(treesit_load_language)

  ld: error: undefined symbol: dynlib_open
  >>> referenced by treesit.c
  >>>               treesit.o:(treesit_load_language)
  cc: error: linker command failed with exit code 1 (use -v to see invocation)
  ----------------------------------------------------------------------

  So add MODULES to TREESITTER_IMPLIES to avoid such options setting.
  * Bump PORTREVISION of ports that use "USES=emacs".

ChangeLog:	https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29.1
Reviewed by:	ashish, jrm
Differential Revision:	https://reviews.freebsd.org/D41444
2023-08-20 09:53:11 +09:00

155 lines
5.6 KiB
Makefile

# Provide support for ports requiring Emacs. This includes flavors with proper
# dependencies and useful variables.
#
# Feature: emacs
# Usage: USES=emacs or USES=emacs:args
# Valid ARGS: build, run, noflavors
#
# build Indicates that Emacs is required at build time.
# run Indicates that Emacs is required at run time.
# noflavors Prevents flavors. This is implied when there is no run
# dependency on Emacs.
#
# If build and run are omitted from the argument list, Emacs will be added to
# BUILD_DEPENDS and RUN_DEPENDS. EMACS_NO_DEPENDS can be set to prevent both
# dependencies.
#
# Variables, which can be set in make.conf:
# DEFAULT_VERSIONS+= The default flavor for Emacs ports (ports with
# USES=emacs, but not the Emacs ports themselves)
# can be added to DEFAULT_VERSIONS. For example,
# DEFAULT_VERSIONS+= emacs=nox
# Valid flavors: full canna nox devel_full devel_nox
# Flavors specified on the command line take
# precedence.
#
# Variables, which can be set by ports:
# EMACS_FLAVORS_EXCLUDE: Do NOT build these Emacs flavors.
# If EMACS_FLAVORS_EXCLUDE is not defined and
# - there is a run dependency on Emacs
# - the noflavors argument is not specified
# then all valid Emacs flavors are assumed.
#
# EMACS_NO_DEPENDS: Do NOT add build or run dependencies on Emacs.
# This will prevent flavors.
#
# Variables, which can be read by ports:
# EMACS_CMD: Emacs command with full path (e.g. /usr/local/bin/emacs-28.2)
# EMACS_FLAVOR: Used for dependencies (e.g. BUILD_DEPENDS= dash.el${EMACS_PKGNAMESUFFIX}>0:devel/dash@${EMACS_FLAVOR})
# EMACS_LIBDIR: Emacs Library directory without ${PREFIX} (e.g. share/emacs)
# EMACS_LIBDIR_WITH_VER: Library directory without ${PREFIX} including version (e.g. share/emacs/28.2)
# EMACS_MAJOR_VER: Emacs major version (e.g. 28)
# EMACS_PKGNAMESUFFIX: PKGNAMESUFFIX to distinguish Emacs flavors
# EMACS_SITE_LISPDIR: Emacs site-lisp directory without ${PREFIX} (e.g. share/emacs/site-lisp)
# EMACS_VER: Emacs version (e.g. 28.2)
# EMACS_VERSION_SITE_LISPDIR: Include version (e.g. share/emacs/28.2/site-lisp)
#-------------------------------------------------------------------------------
#
# MAINTAINER: emacs@FreeBSD.org
.if !defined(_INCLUDE_USES_EMACS_MK)
_INCLUDE_USES_EMACS_MK= yes
# Make sure that no dependency or some other environment variable
# pollutes the build/run dependency detection
.undef _EMACS_BUILD_DEP
.undef _EMACS_RUN_DEP
.undef _EMACS_NOFLAVORS
_EMACS_ARGS= ${emacs_ARGS:S/,/ /g}
. if ${_EMACS_ARGS:Mbuild}
_EMACS_BUILD_DEP= yes
_EMACS_ARGS:= ${_EMACS_ARGS:Nbuild}
. endif
. if ${_EMACS_ARGS:Mrun}
_EMACS_RUN_DEP= yes
_EMACS_ARGS:= ${_EMACS_ARGS:Nrun}
. endif
. if ${_EMACS_ARGS:Mnoflavors}
_EMACS_NOFLAVORS= yes
_EMACS_ARGS:= ${_EMACS_ARGS:Nnoflavors}
. endif
# If the port does not specify a build or run dependency, and does not define
# EMACS_NO_DEPENDS, assume both dependencies are required.
. if !defined(_EMACS_BUILD_DEP) && !defined(_EMACS_RUN_DEP) && \
!defined(EMACS_NO_DEPENDS)
_EMACS_BUILD_DEP= yes
_EMACS_RUN_DEP= yes
. endif
# Only set FLAVORS when...
. if defined(_EMACS_RUN_DEP) && !defined(_EMACS_NOFLAVORS)
FLAVORS= full canna nox devel_full devel_nox
# Sort the default to be first
. if defined(EMACS_DEFAULT)
FLAVORS:= ${EMACS_DEFAULT} ${FLAVORS:N${EMACS_DEFAULT}}
. endif
. for flavor in ${EMACS_FLAVORS_EXCLUDE}
FLAVORS:= ${FLAVORS:N${flavor}}
. endfor
. endif
# Only set FLAVOR when...
. if defined(_EMACS_RUN_DEP) && !defined(_EMACS_NOFLAVORS) && empty(FLAVOR)
. if defined(EMACS_DEFAULT)
FLAVOR= ${EMACS_DEFAULT}
. else
FLAVOR= ${FLAVORS:[1]}
. endif # defined(EMACS_DEFAULT)
. endif # !defined(_EMACS_NOFLAVORS) && defined(_EMACS_RUN_DEP) && empty(FLAVOR)
. if !empty(FLAVOR)
EMACS_FLAVOR= ${FLAVOR}
. else
EMACS_FLAVOR= full
. endif
. if ${FLAVOR:Mdevel*}
EMACS_VER= 30.0.50
EMACS_PORTDIR= editors/emacs-devel
. else
EMACS_VER= 29.1
EMACS_PORTDIR= editors/emacs
. endif
EMACS_MAJOR_VER= ${EMACS_VER:C/\..*//}
EMACS_LIBDIR= share/emacs
EMACS_LIBDIR_WITH_VER= share/emacs/${EMACS_VER}
EMACS_PORT_NAME= emacs${EMACS_MAJOR_VER}
. if ${EMACS_FLAVOR} == "devel_full"
EMACS_PKGNAMESUFFIX= -emacs_devel
. elif ${EMACS_FLAVOR} == "devel_nox"
EMACS_PKGNAMESUFFIX= -emacs_devel_nox
. elif ${EMACS_FLAVOR} == "full"
EMACS_PKGNAMESUFFIX=
. else
EMACS_PKGNAMESUFFIX= -emacs_${EMACS_FLAVOR}
. endif
EMACS_CMD= ${PREFIX}/bin/emacs-${EMACS_VER}
EMACS_SITE_LISPDIR= ${EMACS_LIBDIR}/site-lisp
EMACS_VERSION_SITE_LISPDIR= ${EMACS_LIBDIR_WITH_VER}/site-lisp
. if defined(_EMACS_BUILD_DEP)
BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//}
. endif
. if defined(_EMACS_RUN_DEP)
RUN_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//}
. endif
MAKE_ARGS+= EMACS=${EMACS_CMD}
SCRIPTS_ENV+= EMACS_LIBDIR=${EMACS_LIBDIR} \
EMACS_VER=${EMACS_VER} \
EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \
EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \
EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR}
PLIST_SUB+= EMACS_LIBDIR=${EMACS_LIBDIR} \
EMACS_VER=${EMACS_VER} \
EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \
EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \
EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR}
.endif # _INCLUDE_USES_EMACS_MK