From c59ec5c27a6912fe0ed8ef6cd9039d0e64de694e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 19 Jun 2024 23:58:29 +0200 Subject: [PATCH] znapzend: 0.21.0 -> 0.23.2 Changes: * https://github.com/oetiker/znapzend/releases/tag/v0.21.1 * https://github.com/oetiker/znapzend/releases/tag/v0.22.0 * https://github.com/oetiker/znapzend/releases/tag/v0.23.0 * https://github.com/oetiker/znapzend/releases/tag/v0.23.1 * https://github.com/oetiker/znapzend/releases/tag/v0.23.2 Additionally a few minor things improved: * Only use autoreconfHook, drop manual autotools invocations. * Split outputs. * Add very simple `installCheckPhase` to confirm that `znapzend` can resolve all of its Perl dependencies. --- pkgs/tools/backup/znapzend/default.nix | 73 ++++++++++++-------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/pkgs/tools/backup/znapzend/default.nix b/pkgs/tools/backup/znapzend/default.nix index e4e7124477ae..a31406dd5f49 100644 --- a/pkgs/tools/backup/znapzend/default.nix +++ b/pkgs/tools/backup/znapzend/default.nix @@ -1,68 +1,65 @@ -{ lib, stdenv, fetchFromGitHub, fetchurl, perl, perlPackages, wget, autoconf, automake, autoreconfHook }: +{ 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/master/thirdparty/cpanfile-5.30.snapshot - Mojolicious' = perlPackages.buildPerlPackage rec { - pname = "Mojolicious"; - version = "8.73"; + # 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/S/SR/SRI/${pname}-${version}.tar.gz"; - sha256 = "118y2264f89bbp5ly2dh36xjq25jk85s2ssxa3y4gsgsk6sjzzk1"; + url = "mirror://cpan/authors/id/D/DB/DBOOK/${pname}-${version}.tar.gz"; + hash = "sha256-guBqKdWemc4mC/xp77Wd7qeV2iRqY4wrQ5NRsHtsCnI="; }; - }; - MojoIOLoopForkCall' = perlPackages.buildPerlModule rec { - pname = "Mojo-IOLoop-ForkCall"; - version = "0.20"; - src = fetchurl { - url = "mirror://cpan/authors/id/J/JB/JBERGER/${pname}-${version}.tar.gz"; - sha256 = "19pih5x0ayxs2m8j29qwdpi6ky3w4ghv6vrmax3ix9r59hj6569b"; - }; - propagatedBuildInputs = [ perlPackages.IOPipely Mojolicious' ]; + buildInputs = with perl.pkgs; [ ModuleBuildTiny ]; + propagatedBuildInputs = with perl.pkgs; [ Mojolicious RoleTiny ClassMethodModifiers ]; }; perl' = perl.withPackages (p: - [ MojoIOLoopForkCall' - p.TAPParserSourceHandlerpgTAP + with p; [ + ClassMethodModifiers + ExtUtilsConfig + ExtUtilsHelpers + ExtUtilsInstallPaths + ModuleBuildTiny + MojoLogClearable + Mojolicious + RoleTiny ]); - - version = "0.21.0"; - sha256 = "1lg46rf2ahlclan29zx8ag5k4fjp28sc9l02z76f0pvdlj4qnihl"; in -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "znapzend"; - inherit version; + version = "0.23.2"; src = fetchFromGitHub { owner = "oetiker"; repo = "znapzend"; - rev = "v${version}"; - inherit sha256; + # 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="; }; - buildInputs = [ wget perl' ]; + outputs = [ "out" "man" ]; - nativeBuildInputs = [ autoconf automake autoreconfHook ]; + buildInputs = [ perl' ]; + nativeBuildInputs = [ autoreconfHook ]; - preConfigure = '' + postPatch = '' sed -i 's/^SUBDIRS =.*$/SUBDIRS = lib/' Makefile.am - - grep -v thirdparty/Makefile configure.ac > configure.ac.tmp - mv configure.ac.tmp configure.ac - - autoconf ''; - preBuild = '' - aclocal - automake + 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 ]; + maintainers = with maintainers; [ otwieracz ma27 ]; platforms = platforms.all; }; -} +})