diff mbox series

[bug#48205] gnu: emacs-org: Don't use release tar

Message ID BYAPR05MB402332594AFD396371C61822C5639@BYAPR05MB4023.namprd05.prod.outlook.com
State Accepted
Headers show
Series [bug#48205] gnu: emacs-org: Don't use release tar | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Morgan Smith Nov. 26, 2021, 5:12 a.m. UTC
From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/emacs-xyz.scm (emacs-org):
[source]: Use git repository
[arguments]: Added phases to help with building
[native-inputs]: Added texinfo
---

So I still have no clue why the current emacs-org package is not reproducible,
but I made a package that is reproducible.  It also is building from the
development source so people can use package transformations easier and it
actually runs the tests.


 gnu/packages/emacs-xyz.scm | 46 +++++++++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 13 deletions(-)

Comments

Nicolas Goaziou Nov. 28, 2021, 9:01 p.m. UTC | #1
Hello,

Morgan.J.Smith@outlook.com writes:

> * gnu/packages/emacs-xyz.scm (emacs-org):
> [source]: Use git repository
> [arguments]: Added phases to help with building
> [native-inputs]: Added texinfo
> ---

I tweaked the definition a bit and applied your patch. Thank you.

There's an issue with the M-x org-version output, tho.

Regards,
Michael Rohleder Dec. 2, 2021, 1:57 a.m. UTC | #2
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> There's an issue with the M-x org-version output, tho.

Looks like, this issue breaks emacs-org-re-reveal:

...
starting phase `build'
Checking /gnu/store/k6b8jwnd4l82h7g2dmlh1fcy41ycd0ih-emacs-org-re-reveal-3.12.4/share/emacs/site-lisp/org-re-reveal-3.12.4/...
Compiling /gnu/store/k6b8jwnd4l82h7g2dmlh1fcy41ycd0ih-emacs-org-re-reveal-3.12.4/share/emacs/site-lisp/org-re-reveal-3.12.4/org-re-reveal-autoloads.el...
Compiling /gnu/store/k6b8jwnd4l82h7g2dmlh1fcy41ycd0ih-emacs-org-re-reveal-3.12.4/share/emacs/site-lisp/org-re-reveal-3.12.4/org-re-reveal.el...
Compiling /gnu/store/k6b8jwnd4l82h7g2dmlh1fcy41ycd0ih-emacs-org-re-reveal-3.12.4/share/emacs/site-lisp/org-re-reveal-3.12.4/ox-re-reveal.el...
Invalid version syntax: ‘N/A’ (must start with a number)
command "/gnu/store/4w5rkbxb4l0q06bn07qjm5wps316s3sf-emacs-minimal-27.2/bin/emacs" "--quick" "--batch" "--eval=(eval '(progn (setq byte-compile-debug t) (byte-recompile-directory (file-name-as-directory \"/gnu/store/k6b8jwnd4l82h7g2dmlh1fcy41ycd0ih-emacs-org-re-reveal-3.12.4/share/emacs/site-lisp/org-re-reveal-3.12.4\") 0 1)) t)" failed with status 255
diff mbox series

Patch

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 0cc66b6787..ab7b6fcf6a 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -12439,24 +12439,44 @@  (define-public emacs-org
     (version "9.5")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://elpa.gnu.org/packages/org-" version ".tar"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.savannah.gnu.org/git/emacs/org-mode.git")
+             (commit (string-append "release_" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "16cflg5nms5nb8w86nvwkg49zkl0rvdhigkf4xpvbs0v7zb5y3ky"))))
+        (base32
+         "1gnzx53gkg2c6ljam31bvbibkra66lfx0w04jqmsv2gk8613527r"))))
     (build-system emacs-build-system)
     (arguments
-     `(#:phases
+     `(#:tests? #t
+       #:test-command '("make" "test-dirty")
+       #:phases
        (modify-phases %standard-phases
-         (add-after 'install 'install-documentation
+         (delete 'build)
+         (add-before 'check 'make
+           (lambda _
+             (invoke "make" (string-append "ORGVERSION=" ,version))))
+         (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((share (string-append (assoc-ref outputs "out") "/share"))
-                    (info-dir (string-append share "/info"))
-                    (doc-dir (string-append share "/doc/" ,name "-" ,version)))
-               (install-file "org.info" info-dir)
-               (install-file "orgguide.info" info-dir)
-               ;; XXX: "orgcard.pdf" is not built in Org 9.5.
-               ;; (install-file "orgcard.pdf" doc-dir)
-               ))))))
+             (substitute* "local.mk"
+               (("^prefix.*") (string-append "prefix = " (assoc-ref outputs "out")))
+               (("^lispdir.*")
+                (string-append "lispdir = " (elpa-directory (assoc-ref outputs "out")))))
+             (invoke "make" "install")))
+         (add-after 'unpack 'fix-tests
+           (lambda _
+             ;; These files are modified during testing
+             (make-file-writable "testing/examples/babel.org")
+             (make-file-writable "testing/examples/ob-awk-test.org")
+             (make-file-writable "testing/examples/ob-sed-test.org")
+             (make-file-writable "testing/examples/ob-shell-test.org")
+
+             ;; Specify where sh is
+             (substitute* "testing/examples/babel.org"
+               (("/bin/sh") (which "sh"))))))))
+    (native-inputs
+     `(("texinfo" ,texinfo)))
     (home-page "https://orgmode.org/")
     (synopsis "Outline-based notes management and organizer")
     (description "Org is an Emacs mode for keeping notes, maintaining TODO