4a7f99d55d
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
41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
{ stdenv, lib, makeWrapper, fetchzip, jre }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "bftools";
|
|
version = "6.3.0";
|
|
|
|
src = fetchzip {
|
|
url = "http://downloads.openmicroscopy.org/bio-formats/${version}/artifacts/bftools.zip";
|
|
sha256 = "02nvvmpfglpah1ihd08aw65g1794w588c988cdar1hfl4s80qwhb";
|
|
};
|
|
|
|
installPhase = ''
|
|
find . -maxdepth 1 -perm -111 -type f -not -name "*.sh" \
|
|
-exec install -vD {} "$out"/bin/{} \;
|
|
|
|
mkdir $out/libexec
|
|
mkdir -p $out/share/java
|
|
|
|
cp ./*.sh $out/libexec
|
|
cp ./*.jar $out/share/java
|
|
|
|
for file in $out/bin/*; do
|
|
substituteInPlace $file --replace "\$BF_DIR" $out/libexec
|
|
done
|
|
substituteInPlace $out/libexec/bf.sh --replace "\$BF_JAR_DIR" $out/share/java
|
|
'';
|
|
|
|
postFixup = ''
|
|
wrapProgram $out/libexec/bf.sh --prefix PATH : "${lib.makeBinPath [ jre ]}"
|
|
'';
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
meta = with lib; {
|
|
description = "A bundle of scripts for using Bio-Formats on the command line with bioformats_package.jar already included";
|
|
license = licenses.gpl2;
|
|
platforms = platforms.all;
|
|
homepage = "https://www.openmicroscopy.org/bio-formats/";
|
|
maintainers = [ maintainers.tbenst ];
|
|
};
|
|
}
|