Max Nikulin writes: >> +;; Package-Requires: ((emacs "26.1") (compat "29.1.4.1")) > > Is there a way to express (or (compat "29.1.4.1") (emacs "28.1")) to > avoid installing compat in the case of sufficiently new emacs? E.g. > dpkg/apt allows such alternatives. No, AFAIK: D.8 Conventional Headers for Emacs Libraries ‘Package-Requires’ If this exists, it names packages on which the current package depends for proper operation. *Note Packaging Basics::. This is used by the package manager both at download time (to ensure that a complete set of packages is downloaded) and at activation time (to ensure that a package is only activated if all its dependencies have been). Its format is a list of lists on a single line. The ‘car’ of each sub-list is the name of a package, as a symbol. The ‘cadr’ of each sub-list is the minimum acceptable version number, as a string that can be parsed by ‘version-to-list’. An entry that lacks a version (i.e., an entry which is just a symbol, or a sub-list of one element) is equivalent to entry with version "0". For instance: ;; Package-Requires: ((gnus "1.0") (bubbles "2.7.2") cl-lib (seq)) The package code automatically defines a package named ‘emacs’ with the version number of the currently running Emacs. This can be used to require a minimal version of Emacs for a package. > Early I asked concerning compat-29.1.3. I would prefer to install > elpa-compat system package to avoid network activity in response to > make. Required version matters for those who builds packages for > backport repositories for various linux distributions. It allows to > decide if it is necessary to provide newer elpa-compat or it is enough > to package elpa-org. We can put older version require now, indeed. However, later we should not constrain ourselves about bumping compat version as necessary. Considering Debian lifecycle, it is pretty much guaranteed that we will require the compat version that is not installed by Debian, eventually. In any case, see the attached additional patch. >> compat.el is required for "compile" target. Compilation will simply fail >> with older Emacs. And "test" triggers "compile". > > There are different types of build systems. Some of them allows to > specify which dependencies should be pulled, some do not. My expectation > is that make does not attempt to manage dependencies. For me it is OK to > type an additional command to install them and to fail otherwise. Sure. And you will have such option (EFLAGS). However, I decided to enable auto-downloading by default to not break the previous working compilation instructions. It may, however, be worth documenting EFLAGS in WORG. See the attached patch. > In my opinion > >> + @$(FIND) $(pkgdir) \( -name \*.elc \) -exec $(RM) {} + > > command tells that package management capabilities in Emacs are rather > rudimentary (in comparison to e.g. python toolchain). That is why I am > in favor to more manual dependency management. Notice that I am not > against an option to do it from make. May you elaborate what you mean by "more manual"? What concrete change in the patch do you have in mind? > Untested: > > $(FIND) $(pkgdir) -name \*.elc -delete > > "@" for silencing is intentionally dropped, parenthesis are unnecessary > for single condition. Looks fine, except that now we have part of the targets using $RM variable and part of the targets ignoring it. I am not sure if it is a problem. I am slightly in favour of keeping the existing approach with $RM. >>> default.mk is included from top level Makefile only. >> >> Not sure here. I just noticed that GITVERSION got re-calculated many >> times when looking at debug output of make. (It was slowing things down >> significantly). GITVERSION is in targets.mk though. > > GITVERSION is defined as ?=, so it is a variable with deferred > evaluation. Immediately evaluated variable may defined using := That's what I did in one of the patches (use :=). >>> pkgdir = $(top_builddir)/pkg-deps >> >> How to define top_builddir? If also via `pwd`, I see not much difference. > > I consider it as self-documenting code. Intermediate variable makes it > apparent for readers that the directory is relative to the top of the > package file tree. Agree. Will do. See the attached. > Since out of source tree builds are not supported, I would consider > adding emacs version to path. The idea is to allow keeping installed > packages when switching between several emacs versions. Done.