Subject: [PATCH] gnu: xmlstarlet: Install symlink to xmlstarlet binary.

From: Pierre Langlois <[email-masked]>
Date: Sun, 08 Nov 2020 11:15:29 +0000

Hello Guix!

I recently encountered a small script incompatibility between Guix and
other distros (Arch, Fedora, Debian) because the `xml' binary is often
either moved or symlinked to `xmlstarlet'.

So here's a patch that adds the symlink, is that OK to commit?

Thanks,
Pierre

>From a285bc89eb37a5aa56d444c195d9ef013a30aeec Mon Sep 17 00:00:00 2001
From: Pierre Langlois <[email-masked]>
Date: Fri, 30 Oct 2020 11:57:35 +0000
Subject: [PATCH] gnu: xmlstarlet: Install symlink to xmlstarlet binary.

* gnu/packages/xml.scm (xmlstarlet)[arguments]: Add 'symlink-xmlstarlet
phase.
---
 gnu/packages/xml.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 97d42b2ae2..cd99cd4bcc 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2020 Paul Garlick <[email-masked]>
 ;;; Copyright © 2020 Edouard Klein <[email-masked]>
 ;;; Copyright © 2020 Brett Gilio <[email-masked]>
+;;; Copyright © 2020 Pierre Langlois <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1260,7 +1261,14 @@ C++ programming language.")
            (substitute* "Makefile"
              (("^examples/schema1\\\\") "\\")
              (("^examples/valid1\\\\") "\\"))
-           #t)))))
+           #t))
+       (add-after 'install 'symlink-xmlstarlet
+         (lambda* (#:key outputs #:allow-other-keys)
+           (let* ((out (assoc-ref outputs "out"))
+                  (bin (string-append out "/bin")))
+             (symlink (string-append bin "/xml")
+                      (string-append bin "/xmlstarlet"))
+             #t))))))
    (inputs
     `(("libxslt" ,libxslt)
       ("libxml2" ,libxml2)))
-- 
2.29.2