nixpkgs/pkgs/by-name/fl/flopoco/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

95 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
fetchpatch,
cmake,
installShellFiles,
bison,
boost,
flex,
gmp,
libxml2,
mpfi,
mpfr,
scalp,
sollya,
wcpg,
}:
stdenv.mkDerivation rec {
pname = "flopoco";
version = "4.1.3";
src = fetchFromGitLab {
owner = pname;
repo = pname;
# flopoco-4.1.3 is not tagged on GitLab
rev = "67598298207c9f3261c35679c8a5966480c4343c";
hash = "sha256-0jRjg4/qciqBcjsi6BTbKO4VJkcoEzpC98wFkUOIGbI=";
};
patches = [
(fetchpatch {
name = "fix-clang-error-sin-cos.patch";
url = "https://gitlab.com/flopoco/flopoco/-/commit/de3aa60ad19333952c176c2a2e51f12653ca736b.patch";
postFetch = ''
substituteInPlace $out \
--replace 'FixSinCosCORDIC.hpp' 'CordicSinCos.hpp'
'';
sha256 = "sha256-BlamA/MZuuqqvGYto+jPeQPop6gwva0y394Odw8pdwg=";
})
(fetchpatch {
name = "fix-clang-error-atan2.patch";
url = "https://gitlab.com/flopoco/flopoco/-/commit/a3ffe2436c1b59ee0809b3772b74f2d43c6edb99.patch";
sha256 = "sha256-dSYcufLHDL0p1V1ghmy6X6xse5f6mjUqckaVqLZnTaA=";
})
];
postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
sed -i "s/-pg//g" {,src/Apps/TaMaDi/}CMakeLists.txt
'';
strictDeps = true;
nativeBuildInputs = [
bison
cmake
flex
installShellFiles
];
buildInputs = [
boost
gmp
libxml2
mpfi
mpfr
scalp
sollya
wcpg
];
postBuild = ''
./flopoco BuildAutocomplete
'';
installPhase = ''
runHook preInstall
install -Dm755 flopoco $out/bin/flopoco
cp bin* fp* ieee* longacc* $out/bin/
installShellCompletion --bash flopoco_autocomplete
runHook postInstall
'';
meta = with lib; {
description = "FloPoCo arithmetic core generator";
homepage = "https://flopoco.org/";
license = licenses.unfree;
platforms = platforms.unix;
maintainers = with maintainers; [ wegank ];
};
}