Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 zlib,
6 bzip2,
7 jansson,
8 makeWrapper,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "bedops";
13 version = "2.4.42";
14
15 src = fetchFromGitHub {
16 owner = "bedops";
17 repo = "bedops";
18 rev = "v${version}";
19 sha256 = "sha256-IF2MWGpdnP8PKwLRboe5bxu8N+gV4qZ82BemJE/JCU0=";
20 };
21
22 buildInputs = [
23 zlib
24 bzip2
25 jansson
26 ];
27 nativeBuildInputs = [ makeWrapper ];
28
29 preConfigure = ''
30 # We use nixpkgs versions of these libraries
31 rm -r third-party
32 sed -i '/^LIBS/d' system.mk/*
33 sed -i 's|^LIBRARIES.*$|LIBRARIES = -lbz2 -lz -ljansson|' */*/*/*/Makefile*
34
35 # `make support` installs above libraries
36 substituteInPlace system.mk/* \
37 --replace ": support" ":"
38
39 # Variable name is different in this makefile
40 substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
41 --replace "DIST_DIR" "BINDIR"
42
43 # `mkdir -p $BINDIR` is missing
44 substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
45 --replace 'mkdir -p ''${OBJ_DIR}' 'mkdir -p ''${OBJ_DIR} ''${BINDIR}'
46
47 substituteInPlace applications/bed/starch/src/Makefile --replace '$(LIBRARIES)' ""
48
49 # Function name is different in nixpkgs provided libraries
50 for f in interfaces/src/data/starch/starchFileHelpers.c applications/bed/starch/src/starchcat.c ; do
51 substituteInPlace $f --replace deflateInit2cpp deflateInit2
52 done
53
54 # Don't force static
55 for f in */*/*/*/Makefile* ; do
56 substituteInPlace $f --replace '-static' ""
57 done
58 '';
59
60 makeFlags = [ "BINDIR=$(out)/bin" ];
61
62 postFixup = ''
63 for f in $out/bin/* ; do
64 wrapProgram $f --prefix PATH : "$out/bin"
65 done
66 '';
67
68 meta = with lib; {
69 description = "Suite of tools for addressing questions arising in genomics studies";
70 homepage = "https://github.com/bedops/bedops";
71 license = licenses.gpl2Only;
72 maintainers = with maintainers; [ jbedo ];
73 platforms = platforms.x86_64;
74 };
75}