diff --git a/pkgs/by-name/sp/spades/package.nix b/pkgs/by-name/sp/spades/package.nix index 9a60ee499a64..74b23059cf7b 100644 --- a/pkgs/by-name/sp/spades/package.nix +++ b/pkgs/by-name/sp/spades/package.nix @@ -1,46 +1,74 @@ { lib, stdenv, - fetchurl, - zlib, bzip2, cmake, + fetchFromGitHub, + fetchpatch, + ncurses, python3, + readline, }: stdenv.mkDerivation (finalAttrs: { pname = "spades"; - version = "3.15.5"; + version = "4.0.0"; - src = fetchurl { - url = "https://github.com/ablab/spades/releases/download/v${finalAttrs.version}/SPAdes-${finalAttrs.version}.tar.gz"; - hash = "sha256-FVw2QNVx8uexmgUDHR/Q0ZvYLfeF04hw+5O9JBsSu/o="; + src = fetchFromGitHub { + owner = "ablab"; + repo = "spades"; + rev = "v${finalAttrs.version}"; + hash = "sha256-k2+ddJIgGE41KGZODovU9VdurbWerEtdqNrFDwyuFjo="; }; - sourceRoot = "SPAdes-${finalAttrs.version}/src"; - env.CXXFLAGS = toString [ - # GCC 13: error: 'uint32_t' does not name a type - "-include cstdint" + sourceRoot = "source/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 = [ - zlib bzip2 + ncurses python3 + readline ]; doCheck = true; + strictDeps = true; + meta = { description = "St. Petersburg genome assembler, a toolkit for assembling and analyzing sequencing data"; - license = lib.licenses.gpl2Only; + 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 = [ + "aarch64-linux" "x86_64-linux" "x86_64-darwin" ]; maintainers = with lib.maintainers; [ bzizou ]; + broken = stdenv.hostPlatform.isMusl; }; })