nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchurl,
6 perl,
7 autoreconfHook,
8}:
9
10let
11 # when upgrade znapzend, check versions of Perl libs here: https://github.com/oetiker/znapzend/blob/master/cpanfile
12 # pinned versions are listed at https://github.com/oetiker/znapzend/blob/v0.23.1/thirdparty/cpanfile-5.38.snapshot
13
14 MojoLogClearable = perl.pkgs.buildPerlModule rec {
15 pname = "Mojo-Log-Clearable";
16 version = "1.001";
17 src = fetchurl {
18 url = "mirror://cpan/authors/id/D/DB/DBOOK/Mojo-Log-Clearable-${version}.tar.gz";
19 hash = "sha256-guBqKdWemc4mC/xp77Wd7qeV2iRqY4wrQ5NRsHtsCnI=";
20 };
21 buildInputs = with perl.pkgs; [ ModuleBuildTiny ];
22 propagatedBuildInputs = with perl.pkgs; [
23 Mojolicious
24 RoleTiny
25 ClassMethodModifiers
26 ];
27 };
28
29 perl' = perl.withPackages (
30 p: with p; [
31 ClassMethodModifiers
32 ExtUtilsConfig
33 ExtUtilsHelpers
34 ExtUtilsInstallPaths
35 ModuleBuildTiny
36 MojoLogClearable
37 Mojolicious
38 RoleTiny
39 ]
40 );
41in
42stdenv.mkDerivation (finalAttrs: {
43 pname = "znapzend";
44 version = "0.23.2";
45
46 src = fetchFromGitHub {
47 owner = "oetiker";
48 repo = "znapzend";
49 # Sometimes there's a branch with the same name as the tag,
50 # confusing fetchFromGitHub. Working around this by prefixing
51 # with `refs/tags/`.
52 tag = "v${finalAttrs.version}";
53 hash = "sha256-UvaYzzV+5mZAAwSSMzq4fjCu/mzjeSyQdwQRTZGNktM=";
54 };
55
56 outputs = [
57 "out"
58 "man"
59 ];
60
61 buildInputs = [ perl' ];
62 nativeBuildInputs = [ autoreconfHook ];
63
64 postPatch = ''
65 sed -i 's/^SUBDIRS =.*$/SUBDIRS = lib/' Makefile.am
66 '';
67
68 doInstallCheck = true;
69 installCheckPhase = ''
70 $out/bin/znapzend --version
71 '';
72
73 meta = {
74 description = "High performance open source ZFS backup with mbuffer and ssh support";
75 homepage = "https://www.znapzend.org";
76 license = lib.licenses.gpl3;
77 maintainers = with lib.maintainers; [
78 otwieracz
79 ma27
80 ];
81 platforms = lib.platforms.all;
82 };
83})