nixpkgs/pkgs/by-name/sp/spades/package.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

73 lines
1.7 KiB
Nix

{
lib,
stdenv,
bzip2,
cmake,
fetchFromGitHub,
fetchpatch,
ncurses,
python3,
readline,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "spades";
version = "4.0.0";
src = fetchFromGitHub {
owner = "ablab";
repo = "spades";
rev = "v${finalAttrs.version}";
hash = "sha256-k2+ddJIgGE41KGZODovU9VdurbWerEtdqNrFDwyuFjo=";
};
sourceRoot = "${finalAttrs.src.name}/src";
patches = [
# https://github.com/ablab/spades/pull/1314
(fetchpatch {
name = "copytree.patch";
url = "https://github.com/ablab/spades/commit/af1f756a46c5da669897b841d4f753af1eaa9588.patch";
hash = "sha256-tkT7hb0TqsbLkcTs9u43nzvV8bVdh3G9VKYqFFLrQv8=";
stripLen = 3;
extraPrefix = "projects/";
})
];
cmakeFlags = [
"-DZLIB_ENABLE_TESTS=OFF"
"-DSPADES_BUILD_INTERNAL=OFF"
];
preConfigure = ''
# The CMakeListsInternal.txt file should be empty in the release tarball
echo "" > CMakeListsInternal.txt
'';
nativeBuildInputs = [ cmake ];
buildInputs = [
bzip2
ncurses
python3
readline
];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";
doCheck = true;
strictDeps = true;
meta = {
description = "St. Petersburg genome assembler, a toolkit for assembling and analyzing sequencing data";
changelog = "https://github.com/ablab/spades/blob/${finalAttrs.version}/changelog.md";
downloadPage = "https://github.com/ablab/spades";
homepage = "http://ablab.github.io/spades";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ bzizou ];
broken = stdenv.hostPlatform.isMusl;
};
})