about summary refs log tree commit diff
path: root/pkgs/by-name/bs/bsc/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/bs/bsc/package.nix')
-rw-r--r--pkgs/by-name/bs/bsc/package.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkgs/by-name/bs/bsc/package.nix b/pkgs/by-name/bs/bsc/package.nix
index bb0e762e46f4..4b0cea6f5472 100644
--- a/pkgs/by-name/bs/bsc/package.nix
+++ b/pkgs/by-name/bs/bsc/package.nix
@@ -18,19 +18,27 @@ stdenv.mkDerivation (finalAttrs: {
 
   enableParallelBuilding = true;
 
-  buildInputs = lib.optional stdenv.isDarwin llvmPackages.openmp;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
+
+  postPatch = lib.optional (!stdenv.hostPlatform.isx86) ''
+    substituteInPlace makefile \
+      --replace-fail "-mavx2" ""
+
+    substituteInPlace makefile.cuda \
+      --replace-fail "-mavx2" ""
+  '';
 
   makeFlags = [
     "CC=$(CXX)"
     "PREFIX=${placeholder "out"}"
   ];
 
-  meta = with lib; {
+  meta = {
     description = "High performance block-sorting data compression library";
     homepage = "http://libbsc.com/";
-    maintainers = with maintainers; [ sigmanificient ];
+    maintainers = with lib.maintainers; [ sigmanificient ];
     license = lib.licenses.asl20;
-    platforms = platforms.unix;
+    platforms = lib.platforms.unix;
     mainProgram = "bsc";
   };
 })