Subject: Re: bug#36061: Error when byte compiling

From: "LaFreniere\, Joseph" <[email-masked]>
Date: Wed, 05 Jun 2019 01:32:18 -0500

Robert Weiner <[email-masked]> writes:
> Is the failure repeatable every time?

Yes, the failure is repeatable and occurs with every build attempt 
of 7.0.3, which is the only version I have attempted to package. 
My WIP patch is attached.

> There are some complex ordering dependencies but they are 
> supposed to be handled by the existing file requirements.

Yes, I would have thought that the file requirements would suffice 
to resolve compilation order.

Reading through Guix's source code (namely 
guix/build/emacs-utils.scm), it seems that emacs-build-system 
compiles packages by invoking Emacs with the following arguments:
--quick --batch --eval="(progn (setq byte-compile-debug t) 
  (byte-recompile-directory (file-name-as-directory 
  \"$path_to_hyperbole\") 0 1))"

--
Joseph LaFreniere
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index c2d515ed95..e2b3cdae3c 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -179,6 +179,60 @@ metadata.")
 (define-public geiser
   (deprecated-package "geiser" emacs-geiser))
 
+(define-public emacs-hyperbole
+  (package
+    (name "emacs-hyperbole")
+    (version "7.0.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://ftpmirror.gnu.org/hyperbole/"
+                    "hyperbole-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0znsjhm0lmzpmkgfni4qzx4l6dp604bmrzp3mwxxax2v96wpwmcx"))
+              (patches
+               (search-patches "emacs-hyperbole-domainname.patch"))))
+    (build-system emacs-build-system)
+    (propagated-inputs `(("inetutils" ,inetutils)))
+    (home-page "https://www.gnu.org/software/hyperbole/")
+    (synopsis "The Everyday Hypertextual Information Manager")
+    (description
+     "GNU Hyperbole (pronounced Ga-new Hi-per-bo-lee), or just Hyperbole, is
+an easy-to-use, yet powerful and programmable hypertextual information
+management system implemented as a GNU Emacs package.  It offers rapid views
+and interlinking of all kinds of textual information, utilizing Emacs for
+editing.  It can dramatically increase your productivity and greatly reduce
+the number of keyboard/mouse keys you'll need to work efficiently.
+
+Hyperbole lets you:
+@itemize
+@item Quickly create hyperlink buttons either from the keyboard or by dragging
+between a source and destination window with a mouse button depressed.  Later
+activate buttons by pressing/clicking on them or by giving the name of the
+button.
+@item Activate many kinds of `implicit buttons' recognized by context within
+text buffers, e.g. URLs, grep output lines, and git commits.  A single key or
+mouse button automatically does the right thing in dozens of contexts; just
+press and go.
+@item Build outlines with multi-level numbered outline nodes,e.g. 1.4.8.6,
+that all renumber automatically as any node or tree is moved in the outline.
+Each node also has a permanent hyperlink anchor that you can reference from
+any other node.
+@item Manage all your contacts quickly with hierarchical categories and embed
+hyperlinks within each entry.  Or create an archive of documents with
+hierarchical entries and use the same search mechanism to quickly find any
+matching entry.
+@item Use single keys to easily manage your Emacs windows or frames and
+quickly retrieve saved window and frame configurations;
+@item Search for things in your current buffers, in a directory tree or across
+major web search engines with the touch of a few keys.
+@end itemize
+
+The common thread in all these features is making retrieval, management and
+display of information fast and easy. That is Hyperbole's purpose. ")
+    (license license:gpl3+)))
+
 (define-public emacs-paredit
   (package
     (name "emacs-paredit")
diff --git a/gnu/packages/patches/emacs-hyperbole-domainname.patch b/gnu/packages/patches/emacs-hyperbole-domainname.patch
new file mode 100644
index 0000000000..cf4b63b54b
--- /dev/null
+++ b/gnu/packages/patches/emacs-hyperbole-domainname.patch
@@ -0,0 +1,29 @@
+From 17c87ac58ce6d475fa1987347fcb868ef7f75e40 Mon Sep 17 00:00:00 2001
+From: Joseph LaFreniere <[email-masked]>
+Date: Sun, 2 Jun 2019 12:38:27 -0500
+Subject: [PATCH] Replace executable domainname with hostname
+
+Fixes build failure:
+> ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
+> patch-el-files: unable to locate  "domainname"
+---
+ hypb.el | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/hypb.el b/hypb.el
+index 6abc17a..0332946 100644
+--- a/hypb.el
++++ b/hypb.el
+@@ -183,8 +183,7 @@ Global keymap is used unless optional KEYMAP is given."
+ 
+ (defun hypb:domain-name ()
+   "Returns current Internet domain name with '@' prepended or nil if none."
+-  (let* ((dname-cmd (or (file-exists-p "/usr/bin/domainname")
+-			(file-exists-p "/bin/domainname")))
++  (let* ((dname-cmd (file-exists-p "/bin/hostname"))
+ 	 (dname (or (and (boundp 'message-user-fqdn) (stringp message-user-fqdn)
+ 			 (string-match "\\." message-user-fqdn)
+ 			 message-user-fqdn)
+-- 
+2.21.0
+