3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/version-management/git-and-tools/bfg-repo-cleaner/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

50 lines
1.8 KiB
Nix

{ lib, stdenv, fetchurl, jre, makeWrapper }:
let
version = "1.13.0";
jarName = "bfg-${version}.jar";
mavenUrl = "mirror://maven/com/madgag/bfg/${version}/${jarName}";
in
stdenv.mkDerivation {
inherit version jarName;
name = "bfg-repo-cleaner-${version}";
src = fetchurl {
url = mavenUrl;
sha256 = "1kn84rsvms1v5l1j2xgrk7dc7mnsmxkc6sqd94mnim22vnwvl8mz";
};
buildInputs = [ jre makeWrapper ];
phases = "installPhase";
installPhase = ''
mkdir -p $out/share/java
mkdir -p $out/bin
cp $src $out/share/java/$jarName
makeWrapper "${jre}/bin/java" $out/bin/bfg --add-flags "-cp $out/share/java/$jarName com.madgag.git.bfg.cli.Main"
'';
meta = with lib; {
homepage = "https://rtyley.github.io/bfg-repo-cleaner/";
# Descriptions taken with minor modification from the homepage of bfg-repo-cleaner
description = "Removes large or troublesome blobs in a git repository like git-filter-branch does, but faster";
longDescription = ''
The BFG is a simpler, faster alternative to git-filter-branch for
cleansing bad data out of your Git repository history, in particular removing
crazy big files and removing passwords, credentials, and other private data.
The git-filter-branch command is enormously powerful and can do things
that the BFG can't - but the BFG is much better for the tasks above, because
it's faster (10-720x), simpler (dedicated to just removing things), and
beautiful (can use Scala instead of bash to script customizations).
'';
license = licenses.gpl3;
maintainers = [ maintainers.changlinli ];
platforms = platforms.unix;
downloadPage = "https://mvnrepository.com/artifact/com.madgag/bfg/${version}";
};
}