1 { lib, stdenv, fetchFromGitHub, zlib, bzip2, jansson, makeWrapper }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-VJBoi1+tHA4oOVOsClUfimB+mOV5ZSQsDcDq3vAZwBA=";
14 buildInputs = [ zlib bzip2 jansson ];
15 nativeBuildInputs = [ makeWrapper ];
18 # We use nixpkgs versions of these libraries
20 sed -i '/^LIBS/d' system.mk/*
21 sed -i 's|^LIBRARIES.*$|LIBRARIES = -lbz2 -lz -ljansson|' */*/*/*/Makefile*
23 # `make support` installs above libraries
24 substituteInPlace system.mk/* \
25 --replace ": support" ":"
27 # Variable name is different in this makefile
28 substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
29 --replace "DIST_DIR" "BINDIR"
31 # `mkdir -p $BINDIR` is missing
32 substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
33 --replace 'mkdir -p ''${OBJ_DIR}' 'mkdir -p ''${OBJ_DIR} ''${BINDIR}'
35 substituteInPlace applications/bed/starch/src/Makefile --replace '$(LIBRARIES)' ""
37 # Function name is different in nixpkgs provided libraries
38 for f in interfaces/src/data/starch/starchFileHelpers.c applications/bed/starch/src/starchcat.c ; do
39 substituteInPlace $f --replace deflateInit2cpp deflateInit2
43 for f in */*/*/*/Makefile* ; do
44 substituteInPlace $f --replace '-static' ""
48 makeFlags = [ "BINDIR=$(out)/bin" ];
51 for f in $out/bin/* ; do
52 wrapProgram $f --prefix PATH : "$out/bin"
57 description = "Suite of tools for addressing questions arising in genomics studies";
58 homepage = "https://github.com/bedops/bedops";
59 license = licenses.gpl2Only;
60 maintainers = with maintainers; [ jbedo ];
61 platforms = platforms.x86_64;