nixpkgs/pkgs/applications/science/biology/lumpy/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

51 lines
1.4 KiB
Nix

{ lib, stdenv, fetchFromGitHub, htslib, zlib, curl, openssl, samblaster, sambamba
, samtools, hexdump, python2Packages, which }:
let
python =
python2Packages.python.withPackages (pkgs: with pkgs; [ pysam numpy ]);
in stdenv.mkDerivation rec {
pname = "lumpy";
version = "0.3.1";
src = fetchFromGitHub {
owner = "arq5x";
repo = "lumpy-sv";
rev = "v${version}";
sha256 = "0r71sg7qch8r6p6dw995znrqdj6q49hjdylhzbib2qmv8nvglhs9";
fetchSubmodules = true;
};
nativeBuildInputs = [ which ];
buildInputs =
[ htslib zlib curl openssl python samblaster sambamba samtools hexdump ];
preConfigure = ''
patchShebangs ./.
# Use Nix htslib over bundled version
sed -i 's/lumpy_filter: htslib/lumpy_filter:/' Makefile
sed -i 's|../../lib/htslib/libhts.a|-lhts|' src/filter/Makefile
# Also make sure we use the includes from Nix's htslib
sed -i 's|../../lib/htslib/|${htslib}|' src/filter/Makefile
'';
# Upstream's makefile doesn't have an install target
installPhase = ''
mkdir -p $out
cp -r bin $out
cp -r scripts $out
sed -i 's|/build/source|'$out'|' $out/bin/lumpyexpress.config
'';
meta = with lib; {
description = "Probabilistic structural variant caller";
homepage = "https://github.com/arq5x/lumpy-sv";
maintainers = with maintainers; [ jbedo ];
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
}