summary refs log tree commit diff
path: root/pkgs/tools/text
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2019-12-28 17:20:06 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2019-12-28 17:20:06 +0100
commit749d51bf3562652e48a94f0edf6c2690220fa10d (patch)
tree22f21584a69f0b6492942c0bcf45ecce4d8f9e04 /pkgs/tools/text
parent8bd736c7891899b5a4b7b1208e817fe11daf7ce2 (diff)
downloadnixpkgs-749d51bf3562652e48a94f0edf6c2690220fa10d.tar
nixpkgs-749d51bf3562652e48a94f0edf6c2690220fa10d.tar.gz
nixpkgs-749d51bf3562652e48a94f0edf6c2690220fa10d.tar.bz2
nixpkgs-749d51bf3562652e48a94f0edf6c2690220fa10d.tar.lz
nixpkgs-749d51bf3562652e48a94f0edf6c2690220fa10d.tar.xz
nixpkgs-749d51bf3562652e48a94f0edf6c2690220fa10d.tar.zst
nixpkgs-749d51bf3562652e48a94f0edf6c2690220fa10d.zip
qgrep: fix darwin and aarch64-linux build
https://hydra.nixos.org/build/108321871
https://hydra.nixos.org/build/108556036

Things done:

* SSE2 isn't available for the aarch64-target of GCC (the package builds
  on aarch64 without those flags and works fine as well).

* Added missing darwin libraries.

* Applied a darwin-specific patch which disables i386 as target platform
  (breaks at least on MacOS catalina otherwise).
Diffstat (limited to 'pkgs/tools/text')
-rw-r--r--pkgs/tools/text/qgrep/default.nix17
1 files changed, 15 insertions, 2 deletions
diff --git a/pkgs/tools/text/qgrep/default.nix b/pkgs/tools/text/qgrep/default.nix
index 5f0e7461361..c45398e31a1 100644
--- a/pkgs/tools/text/qgrep/default.nix
+++ b/pkgs/tools/text/qgrep/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, CoreServices, CoreFoundation, fetchpatch }:
 
 stdenv.mkDerivation rec {
   version = "1.1";
@@ -12,6 +12,20 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
+  patches = stdenv.lib.optionals stdenv.isDarwin [
+    (fetchpatch {
+      url = "https://github.com/zeux/qgrep/commit/21c4d1a5ab0f0bdaa0b5ca993c1315c041418cc6.patch";
+      sha256 = "0wpxzrd9pmhgbgby17vb8279xwvkxfdd99gvv7r74indgdxqg7v8";
+    })
+  ];
+
+  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ CoreServices CoreFoundation ];
+
+  postPatch = stdenv.lib.optionalString stdenv.isAarch64 ''
+    substituteInPlace Makefile \
+      --replace "-msse2" "" --replace "-DUSE_SSE2" ""
+  '';
+
   installPhase = '' 
     install -Dm755 qgrep $out/bin/qgrep
   '';
@@ -23,5 +37,4 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.yrashk ];
     platforms = platforms.all;
   };
-
 }