nixpkgs/pkgs/by-name/zn/znapzend/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

66 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;
};
})