depot/third_party/nixpkgs/pkgs/tools/backup/znapzend/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

65 lines
1.9 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchurl, perl, autoreconfHook }:
let
# when upgrade znapzend, check versions of Perl libs here: https://github.com/oetiker/znapzend/blob/master/cpanfile
# pinned versions are listed at https://github.com/oetiker/znapzend/blob/v0.23.1/thirdparty/cpanfile-5.38.snapshot
MojoLogClearable = perl.pkgs.buildPerlModule rec {
pname = "Mojo-Log-Clearable";
version = "1.001";
src = fetchurl {
url = "mirror://cpan/authors/id/D/DB/DBOOK/${pname}-${version}.tar.gz";
hash = "sha256-guBqKdWemc4mC/xp77Wd7qeV2iRqY4wrQ5NRsHtsCnI=";
};
buildInputs = with perl.pkgs; [ ModuleBuildTiny ];
propagatedBuildInputs = with perl.pkgs; [ Mojolicious RoleTiny ClassMethodModifiers ];
};
perl' = perl.withPackages (p:
with p; [
ClassMethodModifiers
ExtUtilsConfig
ExtUtilsHelpers
ExtUtilsInstallPaths
ModuleBuildTiny
MojoLogClearable
Mojolicious
RoleTiny
]);
in
stdenv.mkDerivation (finalAttrs: {
pname = "znapzend";
version = "0.23.2";
src = fetchFromGitHub {
owner = "oetiker";
repo = "znapzend";
# Sometimes there's a branch with the same name as the tag,
# confusing fetchFromGitHub. Working around this by prefixing
# with `refs/tags/`.
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-UvaYzzV+5mZAAwSSMzq4fjCu/mzjeSyQdwQRTZGNktM=";
};
outputs = [ "out" "man" ];
buildInputs = [ perl' ];
nativeBuildInputs = [ autoreconfHook ];
postPatch = ''
sed -i 's/^SUBDIRS =.*$/SUBDIRS = lib/' Makefile.am
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/znapzend --version
'';
meta = with lib; {
description = "High performance open source ZFS backup with mbuffer and ssh support";
homepage = "https://www.znapzend.org";
license = licenses.gpl3;
maintainers = with maintainers; [ otwieracz ma27 ];
platforms = platforms.all;
};
})