unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* emacs: Handling external dependencies
@ 2012-11-10 15:58 Damien Cassou
  2012-11-14  1:19 ` Ethan Glasser-Camp
  2012-11-14  1:32 ` Adam Wolfe Gordon
  0 siblings, 2 replies; 6+ messages in thread
From: Damien Cassou @ 2012-11-10 15:58 UTC (permalink / raw)
  To: notmuch mailing list

Hi,

I recently sent a patch for notmuch emacs that depends on a particular
library. What is the best way to deal with such dependencies?

I can see different solutions:

1) distribute a rewritten version of the dependency so that the code
now belongs to notmuch (e.g., replace the name of the library by
'notmuch'). This has the disadvantage of requiring maintenance when a
new version of the library is released and can also be considered
'stealing' by some authors.

2) use a package manager to load the library. This has the
disadvantage that the now standard package manager is not in
widespread use yet and is not compatible with other OS-based package
managers (such as apt-get in Debian).

3) distribute the dependency with the rest of notmuch and load this
one. This has the disadvantage of possibly shadowing an already
existing version of this library installed through a different means.

4) distribute the dependency with the rest of notmuch (in a separate
"fallback-libs/" directory) and load it only when requiring the
library with the standard load-path does not work. Jonas Bernoulli
gave me a way to do that:

,----
| (or (require 'THE-LIB nil t)
|     (let ((load-path
|           (cons (expand-file-name
|                  "fallback-libs"
|                  (file-name-directory (or load-file-name buffer-file-name)))
|                 load-path)))
|       (require 'THE-LIB)))
`----

What do you think?

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-15 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-10 15:58 emacs: Handling external dependencies Damien Cassou
2012-11-14  1:19 ` Ethan Glasser-Camp
2012-11-14  9:43   ` Tomi Ollila
2012-11-14  1:32 ` Adam Wolfe Gordon
2012-11-14  9:48   ` Tomi Ollila
2012-11-15 14:59   ` Damien Cassou

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).