From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] gnu: diffoscope: Embed tool references. Date: Sun, 1 Jan 2017 10:45:55 +0100 Message-ID: <20170101094555.20151-1-rekado@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNciL-0004h3-An for guix-devel@gnu.org; Sun, 01 Jan 2017 04:46:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNciI-0006YV-2y for guix-devel@gnu.org; Sun, 01 Jan 2017 04:46:05 -0500 Received: from sender-of-o52.zoho.com ([135.84.80.217]:21493) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cNciH-0006Xg-S6 for guix-devel@gnu.org; Sun, 01 Jan 2017 04:46:02 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Fixes . * 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 -;;; Copyright © 2015 Ricardo Wurmus +;;; Copyright © 2015, 2017 Ricardo Wurmus ;;; ;;; 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