diff mbox series

[bug#43248] Fix coqide

Message ID 20200906200203.469c811c@riseup.net
State Accepted
Headers show
Series [bug#43248] Fix coqide | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Csepp Sept. 6, 2020, 6:02 p.m. UTC
coqide wasn't working because it couldn't find coqidetop.opt, because
it was being deleted due to being a duplicate of coqidetop.

I looked at the source to figure out a way to simply convince Coq to
use coqidetop, but it would have require too much patching, also other
tools might assume either coqidetop or coqidetop.opt being available,
so to be safe, I made one into a symlink to the other.

Coqide now works without any weird workarounds.

Comments

Julien Lepiller Sept. 7, 2020, 12:03 p.m. UTC | #1
Le Sun, 6 Sep 2020 20:02:03 +0200,
raingloom <raingloom@riseup.net> a écrit :

> coqide wasn't working because it couldn't find coqidetop.opt, because
> it was being deleted due to being a duplicate of coqidetop.
> 
> I looked at the source to figure out a way to simply convince Coq to
> use coqidetop, but it would have require too much patching, also other
> tools might assume either coqidetop or coqidetop.opt being available,
> so to be safe, I made one into a symlink to the other.
> 
> Coqide now works without any weird workarounds.

Pushed as 1394765238c21030ace4fbb773dc86a9e3c2504c, thank you!
diff mbox series

Patch

From 2bdebad4adfa78b9c0870341dcc08a36f7ad7734 Mon Sep 17 00:00:00 2001
From: raingloom <raingloom@riseup.net>
Date: Sun, 6 Sep 2020 19:11:32 +0200
Subject: [PATCH] gnu: coq: fix coqide not finding coqidetop.opt

* gnu/packages/coq.scm (coq) [arguments]:
  Turn duplicates into symlinks instead of deleting them in remove-duplicate.
---
 gnu/packages/coq.scm | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/coq.scm b/gnu/packages/coq.scm
index 166e66c09e..a0bde5553f 100644
--- a/gnu/packages/coq.scm
+++ b/gnu/packages/coq.scm
@@ -96,11 +96,18 @@ 
          (add-after 'install 'remove-duplicate
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin")))
+                    (bin (string-append out "/bin"))
+                    (coqtop (string-append bin "/coqtop"))
+                    (coqidetop (string-append bin "/coqidetop"))
+                    (coqtop.opt (string-append coqtop ".opt"))
+                    (coqidetop.opt (string-append coqidetop ".opt")))
                ;; These files are exact copies without `.opt` extension.
                ;; Removing these saves 35 MiB in the resulting package.
-               (delete-file (string-append bin "/coqtop.opt"))
-               (delete-file (string-append bin "/coqidetop.opt")))
+               ;; Unfortunately, completely deleting them breaks coqide
+               (delete-file coqtop.opt)
+               (delete-file coqidetop.opt)
+               (symlink coqtop coqtop.opt)
+               (symlink coqidetop coqidetop.opt))
              #t))
          (add-after 'install 'install-ide
            (lambda* (#:key outputs #:allow-other-keys)
-- 
2.28.0