forked from mirrors/nixpkgs
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
43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{ lib, stdenv, fetchurl, autoconf }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "1.99.8";
|
|
pname = "dd_rescue";
|
|
|
|
src = fetchurl {
|
|
sha256 = "1gbxm8gr9sx5g1q9dycs21hkxikcy97q09lp1lvs59pnd9qpdnwh";
|
|
url="http://www.garloff.de/kurt/linux/ddrescue/${pname}-${version}.tar.bz2";
|
|
};
|
|
|
|
dd_rhelp_src = fetchurl {
|
|
url = "http://www.kalysto.org/pkg/dd_rhelp-0.3.0.tar.gz";
|
|
sha256 = "0br6fs23ybmic3i5s1w4k4l8c2ph85ax94gfp2lzjpxbvl73cz1g";
|
|
};
|
|
|
|
buildInputs = [ autoconf ];
|
|
|
|
preBuild = ''
|
|
substituteInPlace Makefile \
|
|
--replace "\$(DESTDIR)/usr" "$out" \
|
|
--replace "-o root" "" \
|
|
--replace "-g root" ""
|
|
'';
|
|
makeFlags = [ "LIBDIR=$out" ];
|
|
|
|
postInstall = ''
|
|
mkdir -p "$out/share/dd_rescue" "$out/bin"
|
|
tar xf "${dd_rhelp_src}" -C "$out/share/dd_rescue"
|
|
cp "$out/share/dd_rescue"/dd_rhelp*/dd_rhelp "$out/bin"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A tool to copy data from a damaged block device";
|
|
maintainers = with maintainers; [ raskin domenkozar ];
|
|
platforms = platforms.linux;
|
|
homepage = "http://www.garloff.de/kurt/linux/ddrescue/";
|
|
license = licenses.gpl2Plus;
|
|
inherit version;
|
|
updateWalker = true;
|
|
};
|
|
}
|