nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 python3Packages,
6 zlib,
7 bash,
8}:
9
10let
11 pythonPackages = python3Packages;
12 inherit (pythonPackages) python;
13in
14
15pythonPackages.buildPythonApplication rec {
16 pname = "quast";
17 version = "5.3.0";
18 format = "setuptools";
19
20 src = fetchurl {
21 url = "https://github.com/ablab/quast/releases/download/${pname}_${version}/${pname}-${version}.tar.gz";
22 hash = "sha256-rJ26A++dClHXqeLFaCYQTnjzQPYmOjrTk2SEQt68dOw=";
23 };
24
25 pythonPath = with pythonPackages; [
26 simplejson
27 joblib
28 setuptools
29 distutils
30 matplotlib
31 ];
32
33 buildInputs = [ zlib ] ++ pythonPath;
34
35 dontConfigure = true;
36
37 dontBuild = true;
38
39 installPhase = ''
40 substituteInPlace quast_libs/bedtools/Makefile \
41 --replace "/bin/bash" "${bash}/bin/bash"
42 mkdir -p "$out/${python.sitePackages}"
43 export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
44 ${python.pythonOnBuildForHost.interpreter} setup.py install \
45 --install-lib=$out/${python.sitePackages} \
46 --prefix="$out"
47 '';
48
49 postFixup = ''
50 for file in $(find $out -type f -type f -perm /0111); do
51 old_rpath=$(patchelf --print-rpath $file) && \
52 patchelf --set-rpath $old_rpath:${lib.getLib stdenv.cc.cc}/lib $file || true
53 done
54 # Link to the master program
55 ln -s $out/bin/quast.py $out/bin/quast
56 '';
57
58 dontPatchELF = true;
59
60 # Tests need to download data files, so manual run after packaging is needed
61 doCheck = false;
62
63 meta = {
64 description = "Evaluates genome assemblies by computing various metrics";
65 homepage = "https://github.com/ablab/quast";
66 sourceProvenance = with lib.sourceTypes; [
67 fromSource
68 binaryNativeCode # source bundles binary dependencies
69 ];
70 license = lib.licenses.gpl2;
71 maintainers = [ lib.maintainers.bzizou ];
72 platforms = lib.platforms.all;
73 };
74}