Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: db69553547af77f059643c9169a03509a0ba834f
Choose a base ref
..
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ac2be3153d8816689115e310487f34d12d639e71
Choose a head ref
89 changes: 0 additions & 89 deletions pkgs/by-name/zs/zsync/fix-build-with-gcc-14.patch

This file was deleted.

45 changes: 28 additions & 17 deletions pkgs/by-name/zs/zsync/package.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
fetchpatch2,
autoreconfHook,
}:

stdenv.mkDerivation rec {
pname = "zsync";
version = "0.6.2";
version = "0.6.2-unstable-2017-04-25";

src = fetchurl {
url = "https://web.archive.org/web/20240805142355/http://zsync.moria.org.uk/download/zsync-${version}.tar.bz2";
hash = "sha256-C51TQzOHqk8EY0psY6XvqCAwcPIpivcqcF+b492mWvI=";
src = fetchFromGitHub {
owner = "cph6";
repo = "zsync";
rev = "6cfe374f8f2310cbd624664ca98e5bb28244ba7a";
hash = "sha256-SnCzNDMyhMx+2JmgsrjtYDa31Ki1EWix9iBfaduDnro=";
};

sourceRoot = "${src.name}/c";

patches = [
# https://github.com/cph6/zsync/issues/20
./fix-build-with-gcc-14.patch
./remove-inexisting-rsumtest.patch
./read-blocksums-declaration-fix.patch
];

env = lib.optionalAttrs stdenv.cc.isClang {
# Suppress error "call to undeclared library function 'strcasecmp'" during compilation.
# The function is found by the linker correctly, so this doesn't introduce any issues.
NIX_CFLAGS_COMPILE = " -Wno-implicit-function-declaration";
makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ];

env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};

makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ];
nativeBuildInputs = [
autoreconfHook
];

meta = with lib; {
homepage = "http://zsync.moria.org.uk/";
meta = {
homepage = "https://github.com/cph6/zsync";
description = "File distribution system using the rsync algorithm";
license = licenses.artistic2;
maintainers = with maintainers; [ viric ];
platforms = with platforms; all;
license = lib.licenses.artistic2;
maintainers = with lib.maintainers; [
viric
ryand56
];
platforms = with lib.platforms; all;
};
}
13 changes: 13 additions & 0 deletions pkgs/by-name/zs/zsync/read-blocksums-declaration-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/libzsync/zsync.c b/libzsync/zsync.c
index 793a426..783c349 100644
--- a/libzsync/zsync.c
+++ b/libzsync/zsync.c
@@ -116,7 +116,7 @@ struct zsync_state {
};

static int zsync_read_blocksums(struct zsync_state *zs, FILE * f,
- int rsum_bytes, int checksum_bytes,
+ int rsum_bytes, unsigned int checksum_bytes,
int seq_matches);
static int zsync_sha1(struct zsync_state *zs, int fh);
static int zsync_recompress(struct zsync_state *zs);
17 changes: 17 additions & 0 deletions pkgs/by-name/zs/zsync/remove-inexisting-rsumtest.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/c/librcksum/Makefile.am b/c/librcksum/Makefile.am
index 0216e49..f4fce72 100644
--- a/librcksum/Makefile.am
+++ b/librcksum/Makefile.am
@@ -2,9 +2,8 @@

noinst_LIBRARIES = librcksum.a

-TESTS = md4test rsumtest
-noinst_PROGRAMS = md4test rsumtest
+TESTS = md4test
+noinst_PROGRAMS = md4test

md4test_SOURCES = md4test.c md4.h md4.c
-rsumtest_SOURCES = rsum.c rsumtest.c hash.c range.c state.c md4.c ../progress.c
librcksum_a_SOURCES = internal.h rcksum.h md4.h rsum.c hash.c state.c range.c md4.c