From 990e96533e4acb7f975bf9d9ffff50bffd11df07 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 3 Aug 2024 16:25:31 +0100 Subject: [PATCH] kissfft: format with `nixfmt-rfc-style` --- pkgs/by-name/ki/kissfft/package.nix | 57 +++++++++++++++-------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/pkgs/by-name/ki/kissfft/package.nix b/pkgs/by-name/ki/kissfft/package.nix index 5156e1ccd898..e7bb8aecca29 100644 --- a/pkgs/by-name/ki/kissfft/package.nix +++ b/pkgs/by-name/ki/kissfft/package.nix @@ -1,15 +1,16 @@ -{ lib -, stdenv -, fetchFromGitHub -, fftw -, fftwFloat -, python3 -, datatype ? "double" -, withTools ? false -, libpng -, enableStatic ? stdenv.hostPlatform.isStatic -, enableOpenmp ? false -, llvmPackages +{ + lib, + stdenv, + fetchFromGitHub, + fftw, + fftwFloat, + python3, + datatype ? "double", + withTools ? false, + libpng, + enableStatic ? stdenv.hostPlatform.isStatic, + enableOpenmp ? false, + llvmPackages, }: let py = python3.withPackages (ps: with ps; [ numpy ]); @@ -26,22 +27,23 @@ stdenv.mkDerivation rec { sha256 = "1yfws5bn4kh62yk6hdyp9h9775l6iz7wsfisbn58jap6b56s8j5s"; }; - patches = [ - ./0001-pkgconfig-darwin.patch - ]; + patches = [ ./0001-pkgconfig-darwin.patch ]; # https://bugs.llvm.org/show_bug.cgi?id=45034 - postPatch = lib.optionalString (stdenv.hostPlatform.isLinux && stdenv.cc.isClang && lib.versionOlder stdenv.cc.version "10") '' - substituteInPlace test/Makefile \ - --replace "-ffast-math" "" - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin) '' - substituteInPlace test/Makefile \ - --replace "LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH" - # Don't know how to make math.h's double long constants available - substituteInPlace test/testcpp.cc \ - --replace "M_PIl" "M_PI" - ''; + postPatch = + lib.optionalString + (stdenv.hostPlatform.isLinux && stdenv.cc.isClang && lib.versionOlder stdenv.cc.version "10") + '' + substituteInPlace test/Makefile \ + --replace "-ffast-math" "" + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin) '' + substituteInPlace test/Makefile \ + --replace "LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH" + # Don't know how to make math.h's double long constants available + substituteInPlace test/testcpp.cc \ + --replace "M_PIl" "M_PI" + ''; makeFlags = [ "PREFIX=${placeholder "out"}" @@ -51,7 +53,8 @@ stdenv.mkDerivation rec { "KISSFFT_OPENMP=${option enableOpenmp}" ]; - buildInputs = lib.optionals (withTools && datatype != "simd") [ libpng ] + buildInputs = + lib.optionals (withTools && datatype != "simd") [ libpng ] # TODO: This may mismatch the LLVM version in the stdenv, see #79818. ++ lib.optional (enableOpenmp && stdenv.cc.isClang) llvmPackages.openmp;