nixpkgs/pkgs/by-name/be/bedops/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

64 lines
1.9 KiB
Nix

{ lib, stdenv, fetchFromGitHub, zlib, bzip2, jansson, makeWrapper }:
stdenv.mkDerivation rec {
pname = "bedops";
version = "2.4.41";
src = fetchFromGitHub {
owner = "bedops";
repo = "bedops";
rev = "v${version}";
sha256 = "sha256-VJBoi1+tHA4oOVOsClUfimB+mOV5ZSQsDcDq3vAZwBA=";
};
buildInputs = [ zlib bzip2 jansson ];
nativeBuildInputs = [ makeWrapper ];
preConfigure = ''
# We use nixpkgs versions of these libraries
rm -r third-party
sed -i '/^LIBS/d' system.mk/*
sed -i 's|^LIBRARIES.*$|LIBRARIES = -lbz2 -lz -ljansson|' */*/*/*/Makefile*
# `make support` installs above libraries
substituteInPlace system.mk/* \
--replace ": support" ":"
# Variable name is different in this makefile
substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
--replace "DIST_DIR" "BINDIR"
# `mkdir -p $BINDIR` is missing
substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
--replace 'mkdir -p ''${OBJ_DIR}' 'mkdir -p ''${OBJ_DIR} ''${BINDIR}'
substituteInPlace applications/bed/starch/src/Makefile --replace '$(LIBRARIES)' ""
# Function name is different in nixpkgs provided libraries
for f in interfaces/src/data/starch/starchFileHelpers.c applications/bed/starch/src/starchcat.c ; do
substituteInPlace $f --replace deflateInit2cpp deflateInit2
done
# Don't force static
for f in */*/*/*/Makefile* ; do
substituteInPlace $f --replace '-static' ""
done
'';
makeFlags = [ "BINDIR=$(out)/bin" ];
postFixup = ''
for f in $out/bin/* ; do
wrapProgram $f --prefix PATH : "$out/bin"
done
'';
meta = with lib; {
description = "Suite of tools for addressing questions arising in genomics studies";
homepage = "https://github.com/bedops/bedops";
license = licenses.gpl2Only;
maintainers = with maintainers; [ jbedo ];
platforms = platforms.x86_64;
};
}