From d339f93f3225ce725106aeb4f59ffcadf1669355 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Fri, 8 Nov 2024 20:37:16 +0800 Subject: [PATCH] bsc: remove axv2 when building on non x86 system --- pkgs/by-name/bs/bsc/package.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/bs/bsc/package.nix b/pkgs/by-name/bs/bsc/package.nix index 03bbb66e5550..4b0cea6f5472 100644 --- a/pkgs/by-name/bs/bsc/package.nix +++ b/pkgs/by-name/bs/bsc/package.nix @@ -20,17 +20,25 @@ stdenv.mkDerivation (finalAttrs: { 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"; }; })