about summary refs log tree commit diff
path: root/grep
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2023-08-30 11:31:40 +0900
committerNguyễn Gia Phong <cnx@loang.net>2023-08-30 14:47:34 +0900
commitbb25f70192a3276f2cca2913e9012d2c56393bd6 (patch)
tree356a76368c9547256ffa9fc0d8118bf6dd5d8379 /grep
parenteb04d8c8cb4521bf611b8df46a96c4132af2520b (diff)
downloadbux-bb25f70192a3276f2cca2913e9012d2c56393bd6.tar.gz
Add md4c bug 107
References: https://github.com/mity/md4c/issues/107
Diffstat (limited to 'grep')
-rw-r--r--grep/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/grep/default.nix b/grep/default.nix
new file mode 100644
index 0000000..ae1e9d3
--- /dev/null
+++ b/grep/default.nix
@@ -0,0 +1,44 @@
+# Recipe for building GNU grep at specific snapshot
+#
+# SPDX-FileCopyrightText: 2003-2012 Eelco Dolstra
+# SPDX-FileCopyrightText: 2009-2011 Ludovic Courtès
+# SPDX-FileCopyrightText: 2009-2010 Rob Vermaas
+# SPDX-FileCopyrightText: 2010 Lluís Batlle i Rossell
+# SPDX-License-Identifier: MIT
+#
+# SPDX-FileCopyrightText: 2023 Nguyễn Gia Phong
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
+{ lib, stdenv, version, base, snapshot, binRenameHook, pcre, libiconv }:
+stdenv.mkDerivation rec {
+  pname = "grep";
+  inherit version;
+
+  nativeBuildInputs = [ binRenameHook ];
+  buildInputs = [ pcre libiconv ];
+  hardeningDisable = [ "all" ];
+
+  src = base;  # bootstrap files
+  postPatch = ''
+    tar xf ${snapshot} --strip-components=1
+  '';
+
+  # On macOS, force use of mkdir -p, since grep's fallback
+  # (./install-sh) is broken.
+  preConfigure = ''
+    export MKDIR_P="mkdir -p"
+  '';
+  doCheck = false;
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/grep";
+    description = "GNU implementation of the Unix grep command";
+    longDescription = ''
+      The grep command searches one or more input files for lines
+      containing a match to a specified pattern.  By default, grep
+      prints the matching lines.
+    '';
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+  };
+}