Discussion:
Adding subdirectories to load-path?
Hauke Fath
2015-09-24 15:51:17 UTC
Permalink
Hi,

for said 'xemacs-packages' package, I would like to re-compile patched
elisp files. In the bootstrap case, I only have XEmacs installed, and
it looks like I need to add the .../lib/xemacs/xemacs-packages/lisp/*/
subdirectories to load-path.

Is there an XEmacs equivalent to the GNU Emacs
"normal-top-level-add-subdirs-to-load-path" function (see
<http://emacswiki.org/emacs/LoadPath>)?

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Michael Sperber
2015-09-25 06:53:39 UTC
Permalink
Post by Hauke Fath
for said 'xemacs-packages' package, I would like to re-compile patched
elisp files. In the bootstrap case, I only have XEmacs installed, and
it looks like I need to add the .../lib/xemacs/xemacs-packages/lisp/*/
subdirectories to load-path.
Is there an XEmacs equivalent to the GNU Emacs
"normal-top-level-add-subdirs-to-load-path" function (see
<http://emacswiki.org/emacs/LoadPath>)?
No. I'm really unsure of what your problem is or of what you're trying
to do. (The paths subsystem should be able to pick up your packages
automatically if they're in a place XEmacs knows about.) Could you
elaborate?
--
Regards,
Mike
Hauke Fath
2015-09-25 08:57:33 UTC
Permalink
Post by Michael Sperber
Post by Hauke Fath
Is there an XEmacs equivalent to the GNU Emacs
"normal-top-level-add-subdirs-to-load-path" function (see
<http://emacswiki.org/emacs/LoadPath>)?
No. I'm really unsure of what your problem is or of what you're trying
to do. (The paths subsystem should be able to pick up your packages
automatically if they're in a place XEmacs knows about.) Could you
elaborate?
I'll try.

pkgsrc ships an "xemacs" (21.4) or "xemacs-current" (21.5) package, and
an "xemacs-packages" package. The latter until noe only untared the
individual xemacs package tarballs, and I am in the process of changing
that, in order to be able to patch individual distribution files.

The xemacs packages come with compiled elisp files; when I patch source
files, I need to recompile them. Now, pkgsrc is about building from
source. In the general case, somebody will install an xemacs, and then
install xemacs-packages to use with it. During the install process, the
elisp files will be in some arbitrary place, but not where the
(previously compiled) xemacs expects them.

To compile those files, xemacs has to be taught about this arbitrary
location. The GNU Emacs "normal-top-level-add-subdirs-to-load-path"
appears to be a handy way to do that.

HTH,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Mats Lidell
2015-09-25 23:02:08 UTC
Permalink
Post by Hauke Fath
pkgsrc ships an "xemacs" (21.4) or "xemacs-current" (21.5) package, and
an "xemacs-packages" package. The latter until noe only untared the
individual xemacs package tarballs, and I am in the process of changing
that, in order to be able to patch individual distribution files.
I acknowledge the problem. I have similar problems with maintenance of
xemacs packages in Gentoo. There we handle the xemacs packages as
binary blobs (and as such can't easily be patched.)

You see, there is one supported way to build xemacs packages and that
is by using the xemacs package source tree. This includes the make
support with dependencies between packages etc so they are guarantied
to get right. That mixes badly with what you want to do as you have
noticed.

In Gentoo we have for now used the following compromise. If there are
packages that needs to be patched we try to get that patch into the
beta release of that package and use the beta package also in the
stable tree. It has its problems but requires little development on
our part.

I guess it is technically possible to do what you are attempting but
that is more or less constructing a new build system for the packages
isn't it? You can do that if you want but if you have full control of
your sources why don't you just clone the xemacs package tree and
patch it there and distribute your own versions of all elisp modules?

I also find that most patches are not distribution dependent and does
more good if they are contributed to the xemacs package tree and even
upstream to that.

Yours
--
%% Mats
Hauke Fath
2015-09-29 14:15:51 UTC
Permalink
Post by Mats Lidell
I guess it is technically possible to do what you are attempting but
that is more or less constructing a new build system for the packages
isn't it?
I hope not. ;)

What I have now, and what appears to work for me, is the following
elisp snippet


(defun add-subdirs-to-load-path (basedir)

"Add all first level dirs below basedir to load-path."

(dolist (f (directory-files basedir))
(let ((name (concat basedir "/" f)))
(when (and (file-directory-p name)
(not (member f '("." "..")))
(add-to-list 'load-path name))))
(add-to-list 'load-path basedir)))

(defun compile-el-file (basedir el-file)

"With a given base path, set up load-path, and byte compile an elisp
source file."

(add-subdirs-to-load-path basedir)
(byte-compile-file el-file))


which the 'editors/semacs-package' Makefile then uses as follows


pre-configure:
[...]
@${ECHO_MSG} "Re-compiling patched elisp files ... "
for ff in `cat ${PATCHDIR}/*.el | awk '/^\\+\\+\\+/ { print $$2
}'` ; do \
${RM} -f ${WRKSRC}/$${ff}.orig ; \
cd ${WRKSRC} && xemacs --vanilla --batch \
--eval "(load-file
\"${PKGDIR}/files/compile-el-file.el\")" \
--eval "(compile-el-file \"${WRKSRC}/lisp\" \
\"${WRKSRC}/$${ff}\")" ; \
done
@${ECHO_MSG} "done"

Cheerio,
hauke
--
The ASCII Ribbon Campaign Hauke Fath
() No HTML/RTF in email Institut für Nachrichtentechnik
/\ No Word docs in email TU Darmstadt
Respect for open standards Ruf +49-6151-16-3281
Michael Sperber
2015-09-26 13:04:49 UTC
Permalink
Post by Hauke Fath
The xemacs packages come with compiled elisp files; when I patch source
files, I need to recompile them. Now, pkgsrc is about building from
source. In the general case, somebody will install an xemacs, and then
install xemacs-packages to use with it. During the install process, the
elisp files will be in some arbitrary place, but not where the
(previously compiled) xemacs expects them.
So this is still a bit too general to give a specific answer. But the
XEmacs manual has a section on "Startup paths" that tells you numerous
ways of influencing where XEmacs looks for elisp stuff.
--
Regards,
Mike
Loading...