nixpkgs-suyu/pkgs/applications/science/biology/kent/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

75 lines
1.7 KiB
Nix

{ lib, stdenv
, libpng
, libuuid
, zlib
, bzip2
, lzma
, openssl
, curl
, libmysqlclient
, bash
, fetchFromGitHub
, which
}:
stdenv.mkDerivation rec {
pname = "kent";
version = "404";
src = fetchFromGitHub {
owner = "ucscGenomeBrowser";
repo = pname;
rev = "v${version}_base";
sha256 = "0l5lmqqc6sqkf4hyk3z4825ly0vdlj5xdfad6zd0708cb1v81nbx";
};
buildInputs = [ libpng libuuid zlib bzip2 lzma openssl curl libmysqlclient ];
patchPhase = ''
substituteInPlace ./src/checkUmask.sh \
--replace "/bin/bash" "${bash}/bin/bash"
substituteInPlace ./src/hg/sqlEnvTest.sh \
--replace "which mysql_config" "${which}/bin/which ${libmysqlclient}/bin/mysql_config"
'';
buildPhase = ''
export MACHTYPE=$(uname -m)
export CFLAGS="-fPIC"
export MYSQLINC=$(mysql_config --include | sed -e 's/^-I//g')
export MYSQLLIBS=$(mysql_config --libs)
export DESTBINDIR=$NIX_BUILD_TOP/bin
export HOME=$NIX_BUILD_TOP
cd ./src
chmod +x ./checkUmask.sh
./checkUmask.sh
mkdir -p $NIX_BUILD_TOP/lib
mkdir -p $NIX_BUILD_TOP/bin/x86_64
make libs
cd jkOwnLib
make
cp ../lib/x86_64/jkOwnLib.a $NIX_BUILD_TOP/lib
cp ../lib/x86_64/jkweb.a $NIX_BUILD_TOP/lib
cd ../utils
make
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
cp $NIX_BUILD_TOP/lib/jkOwnLib.a $out/lib
cp $NIX_BUILD_TOP/lib/jkweb.a $out/lib
cp $NIX_BUILD_TOP/bin/x86_64/* $out/bin
'';
meta = with lib; {
description = "UCSC Genome Bioinformatics Group's suite of biological analysis tools, i.e. the kent utilities";
license = licenses.unfree;
maintainers = with maintainers; [ scalavision ];
platforms = platforms.linux;
};
}