From f76585a44afdc41187df768eec79fb723713cf0c Mon Sep 17 00:00:00 2001 From: rennes Date: Tue, 21 Feb 2017 23:21:49 -0600 Subject: [PATCH] gnu: grep: Fix for gnulib library. * gnu/packages/patches/grep-gnulib-lock.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 3 +- gnu/packages/base.scm | 62 +++++++++++++++-------------- gnu/packages/patches/grep-gnulib-lock.patch | 32 +++++++++++++++ 3 files changed, 66 insertions(+), 31 deletions(-) create mode 100644 gnu/packages/patches/grep-gnulib-lock.patch diff --git a/gnu/local.mk b/gnu/local.mk index 82d9a31bd..806a776f9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -5,7 +5,7 @@ # Copyright © 2013, 2014, 2015, 2016 Mark H Weaver # Copyright © 2016 Chris Marusich # Copyright © 2016, 2017 Kei Kebreau -# Copyright © 2016 Rene Saavedra +# Copyright © 2016, 2017 Rene Saavedra # Copyright © 2016 Adonay "adfeno" Felipe Nogueira # Copyright © 2016, 2017 Ricardo Wurmus # Copyright © 2016 Ben Woodcroft @@ -604,6 +604,7 @@ dist_patch_DATA = \ %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \ %D%/packages/patches/gobject-introspection-cc.patch \ %D%/packages/patches/gobject-introspection-girepository.patch \ + %D%/packages/patches/grep-gnulib-lock.patch \ %D%/packages/patches/grep-timing-sensitive-test.patch \ %D%/packages/patches/grub-CVE-2015-8370.patch \ %D%/packages/patches/grub-gets-undeclared.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 8be9c88ab..f748c7b5c 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2014, 2015 Manolis Fragkiskos Ragkousis ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 Jan Nieuwenhuizen +;;; Copyright © 2017 Rene Saavedra ;;; ;;; This file is part of GNU Guix. ;;; @@ -77,34 +78,35 @@ command-line arguments, multiple languages, and so on.") (define-public grep (package - (name "grep") - (version "3.0") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/grep/grep-" - version ".tar.xz")) - (sha256 - (base32 - "1dcasjp3a578nrvzrcn38mpizb8w1q6mvfzhjmcqqgkf0nsivj72")) - (patches (search-patches "grep-timing-sensitive-test.patch")))) - (build-system gnu-build-system) - (native-inputs `(("perl" ,perl))) ;some of the tests require it - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'install 'fix-egrep-and-fgrep - ;; Patch 'egrep' and 'fgrep' to execute 'grep' via its - ;; absolute file name instead of searching for it in $PATH. - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin"))) - (substitute* (list (string-append bin "/egrep") - (string-append bin "/fgrep")) - (("^exec grep") - (string-append "exec " bin "/grep"))) - #t)))))) - (synopsis "Print lines matching a pattern") - (description + (name "grep") + (version "3.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/grep/grep-" + version ".tar.xz")) + (sha256 + (base32 + "1dcasjp3a578nrvzrcn38mpizb8w1q6mvfzhjmcqqgkf0nsivj72")) + (patches (search-patches "grep-timing-sensitive-test.patch" + "grep-gnulib-lock.patch")))) + (build-system gnu-build-system) + (native-inputs `(("perl" ,perl))) ;some of the tests require it + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'fix-egrep-and-fgrep + ;; Patch 'egrep' and 'fgrep' to execute 'grep' via its + ;; absolute file name instead of searching for it in $PATH. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (substitute* (list (string-append bin "/egrep") + (string-append bin "/fgrep")) + (("^exec grep") + (string-append "exec " bin "/grep"))) + #t)))))) + (synopsis "Print lines matching a pattern") + (description "grep is a tool for finding text inside files. Text is found by matching a pattern provided by the user in one or many files. The pattern may be provided as a basic or extended regular expression, or as fixed @@ -112,8 +114,8 @@ strings. By default, the matching text is simply printed to the screen, however the output can be greatly customized to include, for example, line numbers. GNU grep offers many extensions over the standard utility, including, for example, recursive directory searching.") - (license gpl3+) - (home-page "http://www.gnu.org/software/grep/"))) + (license gpl3+) + (home-page "http://www.gnu.org/software/grep/"))) (define-public sed (package diff --git a/gnu/packages/patches/grep-gnulib-lock.patch b/gnu/packages/patches/grep-gnulib-lock.patch new file mode 100644 index 000000000..68c33f103 --- /dev/null +++ b/gnu/packages/patches/grep-gnulib-lock.patch @@ -0,0 +1,32 @@ +This patch fix error on 'gnulib' library required to build +'grep' package on GNU/Hurd. +The patch was adapted from upstream source repository: +'' + +Commit: 4084b3a1094372b960ce4a97634e08f4538c8bdd + +diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c +index 061562b..afc86f4 100644 +--- a/lib/glthread/lock.c ++++ b/lib/glthread/lock.c +@@ -30,7 +30,7 @@ + + /* ------------------------- gl_rwlock_t datatype ------------------------- */ + +-# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (__GNU_LIBRARY__ > 1)) ++# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1))) + + # ifdef PTHREAD_RWLOCK_INITIALIZER + +diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h +index ec16d39..67932aa 100644 +--- a/lib/glthread/lock.h ++++ b/lib/glthread/lock.h +@@ -179,7 +179,7 @@ typedef pthread_mutex_t gl_lock_t; + + /* ------------------------- gl_rwlock_t datatype ------------------------- */ + +-# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (__GNU_LIBRARY__ > 1)) ++# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1))) + + # ifdef PTHREAD_RWLOCK_INITIALIZER -- 2.11.0