all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: diffoscope: Embed tool references.
@ 2017-01-01  9:45 Ricardo Wurmus
  2017-01-01 19:58 ` Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2017-01-01  9:45 UTC (permalink / raw)
  To: guix-devel

Fixes <http://bugs.gnu.org/25315>.

* gnu/packages/package-management.scm (diffoscope)[inputs]: Add
colordiff and vim.
[arguments]: Add "embed-tool-references" build phase to embed references
to "colordiff", "xxd", and "readelf".
---
 gnu/packages/package-management.scm | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 1b9191cbc..23f34cd30 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -45,12 +45,14 @@
   #:use-module (gnu packages web)
   #:use-module (gnu packages man)
   #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages patchutils)
   #:use-module (gnu packages python)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages cpio)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages ssh)
+  #:use-module (gnu packages vim)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 popen)
@@ -494,12 +496,29 @@ transactions from C or Python.")
                   (add-after 'unpack 'dependency-on-python-magic
                     (lambda _
                       (substitute* "setup.py"
-                        (("'python-magic',") "")))))))
+                        (("'python-magic',") ""))))
+                  (add-after 'unpack 'embed-tool-references
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (substitute* "diffoscope/difference.py"
+                        (("@tool_required\\('colordiff'\\)") "")
+                        (("\\[\"colordiff\"")
+                         (string-append "[\"" (which "colordiff") "\"")))
+                      (substitute* "diffoscope/comparators/utils.py"
+                        (("@tool_required\\('xxd'\\)") "")
+                        (("\\['xxd',")
+                         (string-append "['" (which "xxd") "',")))
+                      (substitute* "diffoscope/comparators/elf.py"
+                        (("@tool_required\\('readelf'\\)") "")
+                        (("\\['readelf',")
+                         (string-append "['" (which "readelf") "',")))
+                      #t)))))
     (inputs `(("rpm" ,rpm)                        ;for rpm-python
               ("python-file" ,python-file)
               ("python-debian" ,python-debian)
               ("python-libarchive-c" ,python-libarchive-c)
               ("python-tlsh" ,python-tlsh)
+              ("colordiff" ,colordiff)
+              ("xxd" ,vim)
 
               ;; Below are modules used for tests.
               ("python-pytest" ,python-pytest)
-- 
2.11.0

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

* Re: [PATCH] gnu: diffoscope: Embed tool references.
  2017-01-01  9:45 [PATCH] gnu: diffoscope: Embed tool references Ricardo Wurmus
@ 2017-01-01 19:58 ` Leo Famulari
  2017-01-01 20:56   ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2017-01-01 19:58 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Sun, Jan 01, 2017 at 10:45:55AM +0100, Ricardo Wurmus wrote:
> Fixes <http://bugs.gnu.org/25315>.
> 
> * gnu/packages/package-management.scm (diffoscope)[inputs]: Add
> colordiff and vim.
> [arguments]: Add "embed-tool-references" build phase to embed references
> to "colordiff", "xxd", and "readelf".

LGTM, thanks!

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

* Re: [PATCH] gnu: diffoscope: Embed tool references.
  2017-01-01 19:58 ` Leo Famulari
@ 2017-01-01 20:56   ` Ricardo Wurmus
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2017-01-01 20:56 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel


Leo Famulari <leo@famulari.name> writes:

> On Sun, Jan 01, 2017 at 10:45:55AM +0100, Ricardo Wurmus wrote:
>> Fixes <http://bugs.gnu.org/25315>.
>>
>> * gnu/packages/package-management.scm (diffoscope)[inputs]: Add
>> colordiff and vim.
>> [arguments]: Add "embed-tool-references" build phase to embed references
>> to "colordiff", "xxd", and "readelf".
>
> LGTM, thanks!

Thanks, I pushed this as 5dbeccf5b4f534dd5519691dfdf58a6921c9f343 and
closed the bug.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
http://elephly.net

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

end of thread, other threads:[~2017-01-01 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-01  9:45 [PATCH] gnu: diffoscope: Embed tool references Ricardo Wurmus
2017-01-01 19:58 ` Leo Famulari
2017-01-01 20:56   ` Ricardo Wurmus

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.