all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#41083] gnu: xfe: Fix hard-coded fhs directories.
@ 2020-05-04 17:16 Raghav Gururajan
  2020-05-04 21:04 ` Ludovic Courtès
  2020-05-04 21:18 ` Nicolas Goaziou
  0 siblings, 2 replies; 7+ messages in thread
From: Raghav Gururajan @ 2020-05-04 17:16 UTC (permalink / raw)
  To: 41083

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-xfe-Fix-hard-coded-fhs-directories.patch --]
[-- Type: text/x-patch, Size: 6332 bytes --]

From 660f134e15438e7ee7aec1c076dca93c68e4edc6 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Mon, 4 May 2020 13:07:02 -0400
Subject: [PATCH] gnu: xfe: Fix hard-coded fhs directories.

* gnu/packages/disk.scm (xfe): Fix hard-coded fhs directories.
[arguments]<#:phases>['patch-xfe-paths]: Delete phase.
[arguments]<#:phases>['patch-bin-dirs]: New phase.
[arguments]<#:phases>['patch-share-dirs]: New phase.
[inputs]<bash,coreutils,file,findutils>: New inputs.
---
 gnu/packages/disk.scm | 109 ++++++++++++++++++++++++++++++++----------
 1 file changed, 83 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 484126a3ea..69f0a131bc 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -48,6 +48,7 @@
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages file-systems)
+  #:use-module (gnu packages file)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -940,43 +941,99 @@ since they are better handled by external tools.")
        (sha256
         (base32 "1fl51k5jm2vrfc2g66agbikzirmp0yb0lqhmsssixfb4mky3hpzs"))))
     (build-system gnu-build-system)
-    (native-inputs
-     `(("intltool" ,intltool)
-       ("pkg-config" ,pkg-config)))
-    (inputs
-     `(("fox" ,fox)
-       ("freetype" ,freetype)
-       ("x11" ,libx11)
-       ("xcb" ,libxcb)
-       ("xcb-util" ,xcb-util)
-       ("xft" ,libxft)
-       ("xrandr" ,libxrandr)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'patch-xfe-paths
+         (add-after 'unpack 'patch-bin-dirs
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let*
+                 ((sh
+                   (string-append
+                    (assoc-ref inputs "bash") "/bin/sh"))
+                  (du
+                   (string-append
+                    (assoc-ref inputs "coreutils") "/bin/du"))
+                  (sort
+                   (string-append
+                    (assoc-ref inputs "coreutils") "/bin/sort"))
+                  (cut
+                      (string-append
+                       (assoc-ref inputs "coreutils") "/bin/cut"))
+                  (ls
+                   (string-append
+                    (assoc-ref inputs "coreutils") "/bin/ls"))
+                  (xargs
+                   (string-append
+                    (assoc-ref inputs "findutils") "/bin/xargs"))
+                  (file
+                   (string-append
+                    (assoc-ref inputs "file") "/bin/file")))
+               (substitute* "src/FilePanel.cpp"
+                 (("/bin/sh") sh)
+                 (("/usr/bin/du") du)
+                 (("/usr/bin/sort") sort)
+                 (("/usr/bin/cut") cut)
+                 (("/usr/bin/xargs") xargs))
+               (substitute* "src/help.h"
+                 (("/bin/sh") sh)
+                 (("/bin/ls") ls))
+               (substitute* "src/SearchPanel.cpp"
+                 (("/usr/bin/du") du)
+                 (("/usr/bin/sort") sort)
+                 (("/usr/bin/cut") cut)
+                 (("/usr/bin/xargs") xargs))
+               (substitute* "src/startupnotification.cpp"
+                 (("/bin/sh") sh))
+               (substitute* "src/xfeutils.cpp"
+                 (("/usr/bin/file") file))
+               #t)))
+         (add-after 'unpack 'patch-share-dirs
            (lambda* (#:key outputs #:allow-other-keys)
              (let*
-                 ((out     (assoc-ref outputs "out"))
-                  (share   (string-append out "/share"))
-                  (xferc   (string-append out "/share/xfe/xferc"))
-                  (xfe-theme   (string-append out "/share/xfe/icons/xfe-theme")))
-               ;; Correct path for xfe registry.
+                 ((out
+                   (assoc-ref outputs "out"))
+                  (share
+                   (string-append out "/share"))
+                  (xfe
+                   (string-append out "/share/xfe"))
+                  (xferc
+                   (string-append out "/share/xfe/xferc"))
+                  (icons
+                   (string-append out "/share/xfe/icons"))
+                  (xfe-theme
+                   (string-append out "/share/xfe/icons/xfe-theme")))
                (substitute* "src/foxhacks.cpp"
-                 (("/etc:/usr/share:/usr/local/share") share))
-               ;; Correct path for xfe configuration.
+                 (("/usr/share") share)
+                 (("/usr/local/share") share))
+               (substitute* "src/help.h"
+                 (("/usr/share/xfe") xfe)
+                 (("/usr/local/share/xfe") xfe)
+                 (("/opt/local/share/xfe") xfe)
+                 (("/usr/share/xfe/icons/xfe-theme") xfe-theme)
+                 (("/usr/local/share/xfe/icons/xfe-theme") xfe-theme))
+               (substitute* "src/xfedefs.h"
+                 (("/usr/share/xfe/icons") icons)
+                 (("/usr/local/share/xfe/icons") icons))
                (substitute* "src/XFileExplorer.cpp"
                  (("/usr/share/xfe/xferc") xferc)
                  (("/usr/local/share/xfe/xferc") xferc)
                  (("/opt/local/share/xfe/xferc") xferc))
-               ;; Correct path for xfe icons.
-               (substitute* "src/xfedefs.h"
-                 (((string-append
-                    "~/.config/xfe/icons/xfe-theme:"
-                    "/usr/local/share/xfe/icons/xfe-theme:"
-                    "/usr/share/xfe/icons/xfe-theme"))
-                  xfe-theme))
                #t))))))
+    (native-inputs
+     `(("intltool" ,intltool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("bash" ,bash)
+       ("coreutils" ,coreutils)
+       ("file" ,file)
+       ("findutils" ,findutils)
+       ("fox" ,fox)
+       ("freetype" ,freetype)
+       ("x11" ,libx11)
+       ("xcb" ,libxcb)
+       ("xcb-util" ,xcb-util)
+       ("xft" ,libxft)
+       ("xrandr" ,libxrandr)))
     (synopsis "File Manager for X-Based Graphical Systems")
     (description"XFE (X File Explorer) is a file manager for X.  It is based on
 the popular but discontinued, X Win Commander.  It aims to be the file manager
-- 
2.26.2


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

* [bug#41083] gnu: xfe: Fix hard-coded fhs directories.
  2020-05-04 17:16 [bug#41083] gnu: xfe: Fix hard-coded fhs directories Raghav Gururajan
@ 2020-05-04 21:04 ` Ludovic Courtès
  2020-05-05 15:44   ` Raghav Gururajan
  2020-05-04 21:18 ` Nicolas Goaziou
  1 sibling, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2020-05-04 21:04 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: 41083

Hello!

Raghav Gururajan <raghavgururajan@disroot.org> skribis:

>>From 660f134e15438e7ee7aec1c076dca93c68e4edc6 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <raghavgururajan@disroot.org>
> Date: Mon, 4 May 2020 13:07:02 -0400
> Subject: [PATCH] gnu: xfe: Fix hard-coded fhs directories.
>
> * gnu/packages/disk.scm (xfe): Fix hard-coded fhs directories.
> [arguments]<#:phases>['patch-xfe-paths]: Delete phase.
> [arguments]<#:phases>['patch-bin-dirs]: New phase.
> [arguments]<#:phases>['patch-share-dirs]: New phase.
> [inputs]<bash,coreutils,file,findutils>: New inputs.

Nitpick: You don’t need to mention #:phases above, and the angle
brackets are inappropriate for inputs.  See ‘git log’ for examples.

> -    (native-inputs
> -     `(("intltool" ,intltool)
> -       ("pkg-config" ,pkg-config)))
> -    (inputs
> -     `(("fox" ,fox)
> -       ("freetype" ,freetype)
> -       ("x11" ,libx11)
> -       ("xcb" ,libxcb)
> -       ("xcb-util" ,xcb-util)
> -       ("xft" ,libxft)
> -       ("xrandr" ,libxrandr)))

To reduce review time :-), it’s a good idea to avoid unnecessary
changes.  In this case, you should avoid moving things around because
that makes the patch harder to read.


> +               (substitute* "src/FilePanel.cpp"
> +                 (("/bin/sh") sh)
> +                 (("/usr/bin/du") du)
> +                 (("/usr/bin/sort") sort)
> +                 (("/usr/bin/cut") cut)
> +                 (("/usr/bin/xargs") xargs))
> +               (substitute* "src/help.h"
> +                 (("/bin/sh") sh)
> +                 (("/bin/ls") ls))
> +               (substitute* "src/SearchPanel.cpp"
> +                 (("/usr/bin/du") du)
> +                 (("/usr/bin/sort") sort)
> +                 (("/usr/bin/cut") cut)
> +                 (("/usr/bin/xargs") xargs))
> +               (substitute* "src/startupnotification.cpp"
> +                 (("/bin/sh") sh))
> +               (substitute* "src/xfeutils.cpp"
> +                 (("/usr/bin/file") file))

I think you can just define a variable like:

  (coreutils (assoc-ref inputs "coreutils"))

and then use (string-append coreutils "/bin/sort") and so on, instead of
defining many variables that have a single user.

>               (let*
> -                 ((out     (assoc-ref outputs "out"))
> -                  (share   (string-append out "/share"))
> -                  (xferc   (string-append out "/share/xfe/xferc"))
> -                  (xfe-theme   (string-append out "/share/xfe/icons/xfe-theme")))
> -               ;; Correct path for xfe registry.
> +                 ((out
> +                   (assoc-ref outputs "out"))
> +                  (share
> +                   (string-append out "/share"))
> +                  (xfe
> +                   (string-append out "/share/xfe"))

Avoid the indentation changes (previous version was fine, although we
usually start the list of bindings on the same line as ‘let*’).

> -               ;; Correct path for xfe icons.
> -               (substitute* "src/xfedefs.h"
> -                 (((string-append
> -                    "~/.config/xfe/icons/xfe-theme:"
> -                    "/usr/local/share/xfe/icons/xfe-theme:"
> -                    "/usr/share/xfe/icons/xfe-theme"))
> -                  xfe-theme))

The ~/.config/xfe bit is going away, right?

Could you send an updated patch?

Thanks,
Ludo’.




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

* [bug#41083] gnu: xfe: Fix hard-coded fhs directories.
  2020-05-04 17:16 [bug#41083] gnu: xfe: Fix hard-coded fhs directories Raghav Gururajan
  2020-05-04 21:04 ` Ludovic Courtès
@ 2020-05-04 21:18 ` Nicolas Goaziou
  2020-05-05 15:36   ` Raghav Gururajan
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2020-05-04 21:18 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: 41083

Hello,

Raghav Gururajan <raghavgururajan@disroot.org> writes:

> From 660f134e15438e7ee7aec1c076dca93c68e4edc6 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <raghavgururajan@disroot.org>
> Date: Mon, 4 May 2020 13:07:02 -0400
> Subject: [PATCH] gnu: xfe: Fix hard-coded fhs directories.

Thank you. Some cosmetics comments follow.

> +         (add-after 'unpack 'patch-bin-dirs
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (let*
> +                 ((sh
> +                   (string-append
> +                    (assoc-ref inputs "bash") "/bin/sh"))

This indentation is unusual. I think it would be clearer to write

  (let* ((sh (string-append (assoc-ref inputs "bash")
                            "/bin/sh"))))

I suggest the following simplification, however:

  (let* ((bash (assoc-ref inputs "bash"))
         (coreutils (assoc-ref inputs "coreutils"))
         (findutils (assoc-ref inputs "findutils"))
         (file (assoc-ref inputs "file")))
   ...)

See below for the consequences of this modification.

> +                  (du
> +                   (string-append
> +                    (assoc-ref inputs "coreutils") "/bin/du"))
> +                  (sort
> +                   (string-append
> +                    (assoc-ref inputs "coreutils") "/bin/sort"))
> +                  (cut
> +                      (string-append
> +                       (assoc-ref inputs "coreutils") "/bin/cut"))

Indentation is off here.

> +               (substitute* "src/FilePanel.cpp"

`substitute*' accepts a list of files as its first argument. Please
consider using the following, assuming you applied the simplification
above.

  (with-directory-excursion "src"
   (substitute* '("FilePanel.cpp" "help.h" "SearchPanel.cpp" ...)
    (("/bin/sh" file) (string-append bash file))
    (("/usr(/bin/du)" _ file) (string-append coreutils file))
    ...))

> +                 ((out
> +                   (assoc-ref outputs "out"))

These should be on the same line.

> +                  (share
> +                   (string-append out "/share"))
> +                  (xfe
> +                   (string-append out "/share/xfe"))

Ditto. You can also re-use share.

> +                  (xferc
> +                   (string-append out "/share/xfe/xferc"))

Ditto. You can re-use xfe.

> +                  (icons
> +                   (string-append out "/share/xfe/icons"))
> +                  (xfe-theme
> +                   (string-append out "/share/xfe/icons/xfe-theme")))
>                 (substitute* "src/foxhacks.cpp"
> -                 (("/etc:/usr/share:/usr/local/share") share))
> -               ;; Correct path for xfe configuration.
> +                 (("/usr/share") share)
> +                 (("/usr/local/share") share))
> +               (substitute* "src/help.h"
> +                 (("/usr/share/xfe") xfe)
> +                 (("/usr/local/share/xfe") xfe)
> +                 (("/opt/local/share/xfe") xfe)
> +                 (("/usr/share/xfe/icons/xfe-theme") xfe-theme)
> +                 (("/usr/local/share/xfe/icons/xfe-theme") xfe-theme))
> +               (substitute* "src/xfedefs.h"
> +                 (("/usr/share/xfe/icons") icons)
> +                 (("/usr/local/share/xfe/icons") icons))

Wouldn't it be simpler to replace "/(usr|opt)(/local)?" with `out' in
all files?

>      (description"XFE (X File Explorer) is a file manager for X.  It is based on
                ^^^^^^
           missing space here

Could you send an updated patch?

Regards,

-- 
Nicolas Goaziou




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

* [bug#41083] gnu: xfe: Fix hard-coded fhs directories.
  2020-05-04 21:18 ` Nicolas Goaziou
@ 2020-05-05 15:36   ` Raghav Gururajan
  0 siblings, 0 replies; 7+ messages in thread
From: Raghav Gururajan @ 2020-05-05 15:36 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 41083

[-- Attachment #1: Type: text/plain, Size: 1560 bytes --]

Hello Nicolas!

> This indentation is unusual. I think it would be clearer to write
> 
>   (let* ((sh (string-append (assoc-ref inputs "bash")
>                             "/bin/sh"))))
> 
> I suggest the following simplification, however:
> 
>   (let* ((bash (assoc-ref inputs "bash"))
>          (coreutils (assoc-ref inputs "coreutils"))
>          (findutils (assoc-ref inputs "findutils"))
>          (file (assoc-ref inputs "file")))
>    ...)
> 
> See below for the consequences of this modification.

Thanks! I used this.

> `substitute*' accepts a list of files as its first argument. Please
> consider using the following, assuming you applied the simplification
> above.
> 
>   (with-directory-excursion "src"
>    (substitute* '("FilePanel.cpp" "help.h" "SearchPanel.cpp" ...)
>     (("/bin/sh" file) (string-append bash file))
>     (("/usr(/bin/du)" _ file) (string-append coreutils file))
>     ...))

Thanks! I used this.

> > +                 ((out
> > +                   (assoc-ref outputs "out"))  
> 
> These should be on the same line.

My new patch somehow has correct indentation.

> Wouldn't it be simpler to replace "/(usr|opt)(/local)?" with `out' in
> all files?

Thanks! I used this. But the above would conflict with "/usr/bin". So I used
"/(usr|opt)(/local)?/share".

> >      (description"XFE (X File Explorer) is a file manager for X.  It is
> > based on  
>                 ^^^^^^
>            missing space here

Fixed!

> Could you send an updated patch?

Please find updated patch attached with this email.

Regards,
RG.

[-- Attachment #2: 0001-gnu-xfe-Fix-hard-coded-fhs-directories.patch --]
[-- Type: text/x-patch, Size: 4939 bytes --]

From e7032ff0032bbdbaefa8505f9f882fc6df58adaf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Tue, 5 May 2020 11:22:01 -0400
Subject: [PATCH] gnu: xfe: Fix hard-coded fhs directories.

* gnu/packages/disk.scm (xfe):
[arguments]: Remove phase 'patch-xfe-paths.
[arguments]: Add phases 'patch-bin-dirs and 'patch-share-dirs.
[inputs]: Add bash, coreutils, file and findutils.
---
 gnu/packages/disk.scm | 66 +++++++++++++++++++++++++------------------
 1 file changed, 38 insertions(+), 28 deletions(-)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 484126a3ea..e018df33fb 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -48,6 +48,7 @@
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages file-systems)
+  #:use-module (gnu packages file)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -940,45 +941,54 @@ since they are better handled by external tools.")
        (sha256
         (base32 "1fl51k5jm2vrfc2g66agbikzirmp0yb0lqhmsssixfb4mky3hpzs"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-bin-dirs
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let*
+                 ((bash (assoc-ref inputs "bash"))
+                  (coreutils (assoc-ref inputs "coreutils"))
+                  (findutils (assoc-ref inputs "findutils"))
+                  (file-prog (assoc-ref inputs "file")))
+               (with-directory-excursion "src"
+                 (substitute* '("FilePanel.cpp" "help.h" "SearchPanel.cpp"
+                                "startupnotification.cpp" "xfeutils.cpp")
+                   (("/bin/sh" file) (string-append bash file))
+                   (("/bin/ls" file) (string-append coreutils file))
+                   (("/usr(/bin/du)" _ file) (string-append coreutils file))
+                   (("/usr(/bin/sort)" _ file) (string-append coreutils file))
+                   (("/usr(/bin/cut)" _ file) (string-append coreutils file))
+                   (("/usr(/bin/xargs)" _ file) (string-append findutils file))
+                   (("/usr(/bin/file)" _ file) (string-append file-prog file))))
+               #t)))
+         (add-after 'unpack 'patch-share-dirs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let*
+                 ((out (assoc-ref outputs "out"))
+                  (share (string-append out "/share")))
+               (with-directory-excursion "src"
+                 (substitute* '("foxhacks.cpp" "help.h" "xfedefs.h"
+                                "XFileExplorer.cpp")
+                   (("/(usr|opt)(/local)?/share") share)))
+               #t))))))
     (native-inputs
      `(("intltool" ,intltool)
        ("pkg-config" ,pkg-config)))
     (inputs
-     `(("fox" ,fox)
+     `(("bash" ,bash)
+       ("coreutils" ,coreutils)
+       ("file" ,file)
+       ("findutils" ,findutils)
+       ("fox" ,fox)
        ("freetype" ,freetype)
        ("x11" ,libx11)
        ("xcb" ,libxcb)
        ("xcb-util" ,xcb-util)
        ("xft" ,libxft)
        ("xrandr" ,libxrandr)))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-xfe-paths
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let*
-                 ((out     (assoc-ref outputs "out"))
-                  (share   (string-append out "/share"))
-                  (xferc   (string-append out "/share/xfe/xferc"))
-                  (xfe-theme   (string-append out "/share/xfe/icons/xfe-theme")))
-               ;; Correct path for xfe registry.
-               (substitute* "src/foxhacks.cpp"
-                 (("/etc:/usr/share:/usr/local/share") share))
-               ;; Correct path for xfe configuration.
-               (substitute* "src/XFileExplorer.cpp"
-                 (("/usr/share/xfe/xferc") xferc)
-                 (("/usr/local/share/xfe/xferc") xferc)
-                 (("/opt/local/share/xfe/xferc") xferc))
-               ;; Correct path for xfe icons.
-               (substitute* "src/xfedefs.h"
-                 (((string-append
-                    "~/.config/xfe/icons/xfe-theme:"
-                    "/usr/local/share/xfe/icons/xfe-theme:"
-                    "/usr/share/xfe/icons/xfe-theme"))
-                  xfe-theme))
-               #t))))))
     (synopsis "File Manager for X-Based Graphical Systems")
-    (description"XFE (X File Explorer) is a file manager for X.  It is based on
+    (description "XFE (X File Explorer) is a file manager for X.  It is based on
 the popular but discontinued, X Win Commander.  It aims to be the file manager
 of choice for all light thinking Unix addicts!")
     (home-page "http://roland65.free.fr/xfe/")
-- 
2.26.2


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

* [bug#41083] gnu: xfe: Fix hard-coded fhs directories.
  2020-05-04 21:04 ` Ludovic Courtès
@ 2020-05-05 15:44   ` Raghav Gururajan
  2020-05-06 15:39     ` bug#41083: " Nicolas Goaziou
  2020-05-06 15:52     ` [bug#41083] " Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Raghav Gururajan @ 2020-05-05 15:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41083

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

Hello Ludo!

> Nitpick: You don’t need to mention #:phases above, and the angle
> brackets are inappropriate for inputs.  See ‘git log’ for examples.

Fixed!
 
> To reduce review time :-), it’s a good idea to avoid unnecessary
> changes.  In this case, you should avoid moving things around because
> that makes the patch harder to read.

Sorry about that. I was making the definition consistent with the order
mentioned in
https://guix.gnu.org/manual/en/html_node/Defining-Packages.html#Defining-Packages

> I think you can just define a variable like:
> 
>   (coreutils (assoc-ref inputs "coreutils"))
> 
> and then use (string-append coreutils "/bin/sort") and so on, instead of
> defining many variables that have a single user.
>
> Avoid the indentation changes (previous version was fine, although we
> usually start the list of bindings on the same line as ‘let*’).

I have changed some things in my new patch.

> The ~/.config/xfe bit is going away, right?

No. It is not necessary to remove it, as it is only an alternative dir. Xfe now
looks in 'out', if ~/.config/xfe doesn't exist. :-) 

> Could you send an updated patch?

Please find the updated patch attached with this email.

Regards,
RG.

[-- Attachment #2: 0001-gnu-xfe-Fix-hard-coded-fhs-directories.patch --]
[-- Type: text/x-patch, Size: 4939 bytes --]

From e7032ff0032bbdbaefa8505f9f882fc6df58adaf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Tue, 5 May 2020 11:22:01 -0400
Subject: [PATCH] gnu: xfe: Fix hard-coded fhs directories.

* gnu/packages/disk.scm (xfe):
[arguments]: Remove phase 'patch-xfe-paths.
[arguments]: Add phases 'patch-bin-dirs and 'patch-share-dirs.
[inputs]: Add bash, coreutils, file and findutils.
---
 gnu/packages/disk.scm | 66 +++++++++++++++++++++++++------------------
 1 file changed, 38 insertions(+), 28 deletions(-)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 484126a3ea..e018df33fb 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -48,6 +48,7 @@
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages file-systems)
+  #:use-module (gnu packages file)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -940,45 +941,54 @@ since they are better handled by external tools.")
        (sha256
         (base32 "1fl51k5jm2vrfc2g66agbikzirmp0yb0lqhmsssixfb4mky3hpzs"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-bin-dirs
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let*
+                 ((bash (assoc-ref inputs "bash"))
+                  (coreutils (assoc-ref inputs "coreutils"))
+                  (findutils (assoc-ref inputs "findutils"))
+                  (file-prog (assoc-ref inputs "file")))
+               (with-directory-excursion "src"
+                 (substitute* '("FilePanel.cpp" "help.h" "SearchPanel.cpp"
+                                "startupnotification.cpp" "xfeutils.cpp")
+                   (("/bin/sh" file) (string-append bash file))
+                   (("/bin/ls" file) (string-append coreutils file))
+                   (("/usr(/bin/du)" _ file) (string-append coreutils file))
+                   (("/usr(/bin/sort)" _ file) (string-append coreutils file))
+                   (("/usr(/bin/cut)" _ file) (string-append coreutils file))
+                   (("/usr(/bin/xargs)" _ file) (string-append findutils file))
+                   (("/usr(/bin/file)" _ file) (string-append file-prog file))))
+               #t)))
+         (add-after 'unpack 'patch-share-dirs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let*
+                 ((out (assoc-ref outputs "out"))
+                  (share (string-append out "/share")))
+               (with-directory-excursion "src"
+                 (substitute* '("foxhacks.cpp" "help.h" "xfedefs.h"
+                                "XFileExplorer.cpp")
+                   (("/(usr|opt)(/local)?/share") share)))
+               #t))))))
     (native-inputs
      `(("intltool" ,intltool)
        ("pkg-config" ,pkg-config)))
     (inputs
-     `(("fox" ,fox)
+     `(("bash" ,bash)
+       ("coreutils" ,coreutils)
+       ("file" ,file)
+       ("findutils" ,findutils)
+       ("fox" ,fox)
        ("freetype" ,freetype)
        ("x11" ,libx11)
        ("xcb" ,libxcb)
        ("xcb-util" ,xcb-util)
        ("xft" ,libxft)
        ("xrandr" ,libxrandr)))
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-xfe-paths
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let*
-                 ((out     (assoc-ref outputs "out"))
-                  (share   (string-append out "/share"))
-                  (xferc   (string-append out "/share/xfe/xferc"))
-                  (xfe-theme   (string-append out "/share/xfe/icons/xfe-theme")))
-               ;; Correct path for xfe registry.
-               (substitute* "src/foxhacks.cpp"
-                 (("/etc:/usr/share:/usr/local/share") share))
-               ;; Correct path for xfe configuration.
-               (substitute* "src/XFileExplorer.cpp"
-                 (("/usr/share/xfe/xferc") xferc)
-                 (("/usr/local/share/xfe/xferc") xferc)
-                 (("/opt/local/share/xfe/xferc") xferc))
-               ;; Correct path for xfe icons.
-               (substitute* "src/xfedefs.h"
-                 (((string-append
-                    "~/.config/xfe/icons/xfe-theme:"
-                    "/usr/local/share/xfe/icons/xfe-theme:"
-                    "/usr/share/xfe/icons/xfe-theme"))
-                  xfe-theme))
-               #t))))))
     (synopsis "File Manager for X-Based Graphical Systems")
-    (description"XFE (X File Explorer) is a file manager for X.  It is based on
+    (description "XFE (X File Explorer) is a file manager for X.  It is based on
 the popular but discontinued, X Win Commander.  It aims to be the file manager
 of choice for all light thinking Unix addicts!")
     (home-page "http://roland65.free.fr/xfe/")
-- 
2.26.2


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

* bug#41083: gnu: xfe: Fix hard-coded fhs directories.
  2020-05-05 15:44   ` Raghav Gururajan
@ 2020-05-06 15:39     ` Nicolas Goaziou
  2020-05-06 15:52     ` [bug#41083] " Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2020-05-06 15:39 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: Ludovic Courtès, 41083-done

Hello,

Raghav Gururajan <raghavgururajan@disroot.org> writes:

> Please find the updated patch attached with this email.

Thank you. I applied it, with the following few cosmetics changes.

> Subject: [PATCH] gnu: xfe: Fix hard-coded fhs directories.
>
> * gnu/packages/disk.scm (xfe):
> [arguments]: Remove phase 'patch-xfe-paths.
> [arguments]: Add phases 'patch-bin-dirs and 'patch-share-dirs.

I merged these two lines.

> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (let*
> +                 ((bash (assoc-ref inputs "bash"))

I moved the bash binding onto the same line as let*.

> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let*
> +                 ((out (assoc-ref outputs "out"))

Ditto.

Regards,

-- 
Nicolas Goaziou




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

* [bug#41083] gnu: xfe: Fix hard-coded fhs directories.
  2020-05-05 15:44   ` Raghav Gururajan
  2020-05-06 15:39     ` bug#41083: " Nicolas Goaziou
@ 2020-05-06 15:52     ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2020-05-06 15:52 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: 41083-done

Hi,

Raghav Gururajan <raghavgururajan@disroot.org> skribis:

>>From e7032ff0032bbdbaefa8505f9f882fc6df58adaf Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <raghavgururajan@disroot.org>
> Date: Tue, 5 May 2020 11:22:01 -0400
> Subject: [PATCH] gnu: xfe: Fix hard-coded fhs directories.
>
> * gnu/packages/disk.scm (xfe):
> [arguments]: Remove phase 'patch-xfe-paths.
> [arguments]: Add phases 'patch-bin-dirs and 'patch-share-dirs.
> [inputs]: Add bash, coreutils, file and findutils.

Great.  Applied, thanks!

(And thanks to Nicolas as well.)

Ludo’.




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

end of thread, other threads:[~2020-05-06 15:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04 17:16 [bug#41083] gnu: xfe: Fix hard-coded fhs directories Raghav Gururajan
2020-05-04 21:04 ` Ludovic Courtès
2020-05-05 15:44   ` Raghav Gururajan
2020-05-06 15:39     ` bug#41083: " Nicolas Goaziou
2020-05-06 15:52     ` [bug#41083] " Ludovic Courtès
2020-05-04 21:18 ` Nicolas Goaziou
2020-05-05 15:36   ` Raghav Gururajan

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.