[PATCH] gnu: git-annex: Patch 'git-annex webapp' to use hardcoded xdg-open.

  • Done
  • quality assurance status badge
Details
3 participants
  • Thompson, David
  • Mathieu Othacehe
  • Simon Tournier
Owner
unassigned
Submitted by
Thompson, David
Severity
normal

Debbugs page

Thompson, David wrote 2 years ago
(address . guix-patches@gnu.org)
CAJ=RwfZvCeSMA=Hcab6Gzq_LfBWvtv7dXDwFrJwHSP7kAtfkCQ@mail.gmail.com
Hi all,

I was using git-annex for the very first time today and when I tried
to run 'git-annex webapp' I got this error:

Launching web browser on file:///tmp/webapp3975-0.html
git-annex: xdg-open: createProcess: posix_spawnp: does not exist
(No such file or directory)
WebApp crashed: xdg-open: createProcess: posix_spawnp: does not
exist (No such file or directory)

I think this should just work so I wrote a patch to replace a couple
of loose references to xdg-open with a hardcoded store path.

How does it look?

Thanks,

- Dave
From 6013aa4bf4336e06ca35ee070d090c88e34e898d Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Fri, 6 Jan 2023 16:06:47 -0500
Subject: [PATCH] gnu: git-annex: Patch 'git-annex webapp' to use hardcoded
xdg-open.

* gnu/packages/haskell-apps.scm (git-annex)[arguments]: Add 'patch-webapp'
phase.
[inputs]: Add xdg-utils.
---
gnu/packages/haskell-apps.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Toggle diff (46 lines)
diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index a2405796ca..4ac486eeb6 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2021 EuAndreh <eu@euandre.org>
;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
+;;; Copyright © 2022 David Thompson <dthompson2@worcester.edu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -42,6 +43,7 @@ (define-module (gnu packages haskell-apps)
#:use-module (guix build-system haskell)
#:use-module (gnu packages)
#:use-module (gnu packages curl)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages gl)
#:use-module (gnu packages haskell)
#:use-module (gnu packages haskell-check)
@@ -327,6 +329,13 @@ (define-public git-annex
(copy-file "Utility/Shell.hs" "/tmp/Shell.hs")
(substitute* "Utility/Shell.hs"
(("/bin/sh") (which "sh")))))
+ (add-before 'configure 'patch-webapp
+ (lambda _
+ ;; Replace loose references to xdg-open so that 'git annex
+ ;; webapp' runs without making the user also install xdg-utils.
+ (substitute* '("Assistant/WebApp/DashBoard.hs"
+ "Utility/WebApp.hs")
+ (("xdg-open") (which "xdg-open")))))
(add-before 'configure 'factor-setup
(lambda _
;; Factor out necessary build logic from the provided
@@ -471,7 +480,8 @@ (define-public git-annex
ghc-yesod-core
ghc-yesod-form
ghc-yesod-static
- rsync))
+ rsync
+ xdg-utils))
(propagated-inputs
(list git))
(native-inputs
--
2.38.1
Mathieu Othacehe wrote 2 years ago
(name . Thompson, David)(address . dthompson2@worcester.edu)(address . 60609@debbugs.gnu.org)
87o7r9uoxi.fsf@gnu.org
Hello David,

Toggle quote (5 lines)
> I think this should just work so I wrote a patch to replace a couple
> of loose references to xdg-open with a hardcoded store path.
>
> How does it look?

Looks fine, please go ahead!

Mathieu
Thompson, David wrote 2 years ago
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 60609-done@debbugs.gnu.org)
CAJ=RwfYqvOjphWgiy-YiPr4B2h=V3DEo9RidP3M9H+pQw3trGg@mail.gmail.com
On Sun, Jan 8, 2023 at 8:38 AM Mathieu Othacehe <othacehe@gnu.org> wrote:
Toggle quote (11 lines)
>
>
> Hello David,
>
> > I think this should just work so I wrote a patch to replace a couple
> > of loose references to xdg-open with a hardcoded store path.
> >
> > How does it look?
>
> Looks fine, please go ahead!

Pushed, thanks!

- Dave
Closed
Simon Tournier wrote 2 years ago
Re: [bug#60609] [PATCH] gnu: git-annex: Patch 'git-annex webapp' to use hardcoded xdg-open.
87wn5rx1ef.fsf@gmail.com
Hi,

On ven., 06 janv. 2023 at 16:30, "Thompson, David" <dthompson2@worcester.edu> wrote:

Toggle quote (4 lines)
> * gnu/packages/haskell-apps.scm (git-annex)[arguments]: Add 'patch-webapp'
> phase.
> [inputs]: Add xdg-utils.

This adds 130MB to the closure. Well, it is only 5.5% of the complete
closure but that’s not nothing either. :-)

Maybe it could be worth to split this large package; either
git-annex-minimal and git-annex, or two outputs. Because, we build it
using this:

`(#:configure-flags
'("--flags=-Android -Webapp")

when I do not use the Webapp, for instance. :-)

Cheers,
simon
Thompson, David wrote 2 years ago
(name . Simon Tournier)(address . zimon.toutoune@gmail.com)(address . 60609@debbugs.gnu.org)
CAJ=RwfZk5kkHCQD5mrVFozq0mda6=N=Tz637o04B0KyGsu=MVA@mail.gmail.com
Hi Simon,

On Thu, Jan 12, 2023 at 12:46 PM Simon Tournier
<zimon.toutoune@gmail.com> wrote:
Toggle quote (21 lines)
>
> Hi,
>
> On ven., 06 janv. 2023 at 16:30, "Thompson, David" <dthompson2@worcester.edu> wrote:
>
> > * gnu/packages/haskell-apps.scm (git-annex)[arguments]: Add 'patch-webapp'
> > phase.
> > [inputs]: Add xdg-utils.
>
> This adds 130MB to the closure. Well, it is only 5.5% of the complete
> closure but that’s not nothing either. :-)
>
> Maybe it could be worth to split this large package; either
> git-annex-minimal and git-annex, or two outputs. Because, we build it
> using this:
>
> `(#:configure-flags
> '("--flags=-Android -Webapp")
>
> when I do not use the Webapp, for instance. :-)

I figured that since git-annex is already so huge and it's not a core
thing that it wouldn't be a big deal to add some size in order to make
more features work properly without having to troubleshoot. I'd be in
favor of a minimal variant for those that don't want the full
git-annex feature set.

- Dave
?
Your comment

This issue is archived.

To comment on this conversation send an email to 60609@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 60609
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help