base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / zs / zsync2 / package.nix
blob70a204eafab67e463d0cd031ebb09bfba7c9f617
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   cmake,
7   pkg-config,
8   libgcrypt,
9   libcpr,
10   libargs,
13 stdenv.mkDerivation (finalAttrs: {
14   pname = "zsync2";
15   version = "2.0.0-alpha-1-20230304";
17   src = fetchFromGitHub {
18     owner = "AppImageCommunity";
19     repo = "zsync2";
20     rev = finalAttrs.version;
21     hash = "sha256-OCeMEXQmbc34MZ1NyOfAASdrUyeSQqqfvWqAszJN4x0=";
22   };
24   patches = [
25     # Add missing cstdint includes
26     (fetchpatch {
27       url = "https://github.com/AppImageCommunity/zsync2/commit/e57e1fce68194fa920542fd334488de5123e4832.patch";
28       hash = "sha256-iLXxD6v+pSwFKmwAEyzbYUJ3DmtpvV/DYr8kcD+t5Cg=";
29     })
30   ];
32   postPatch = ''
33     substituteInPlace CMakeLists.txt \
34       --replace-fail 'VERSION "2.0.0-alpha-1"' 'VERSION "${finalAttrs.version}"' \
35       --replace-fail 'git rev-parse --short HEAD' 'bash -c "echo unknown"' \
36       --replace-fail '<local dev build>' '<nixpkgs build>' \
37       --replace-fail 'env LC_ALL=C date -u "+%Y-%m-%d %H:%M:%S %Z"' 'bash -c "echo 1970-01-01 00:00:01 UTC"'
38   '';
40   nativeBuildInputs = [
41     cmake
42     pkg-config
43   ];
45   buildInputs = [
46     libgcrypt
47     libcpr
48     libargs
49   ];
51   cmakeFlags = [
52     (lib.cmakeBool "USE_SYSTEM_CPR" true)
53     (lib.cmakeBool "USE_SYSTEM_ARGS" true)
54   ];
56   meta = {
57     description = "Rewrite of the advanced file download/sync tool zsync";
58     homepage = "https://github.com/AppImageCommunity/zsync2";
59     license = lib.licenses.artistic2;
60     mainProgram = "zsync2";
61     maintainers = with lib.maintainers; [ aleksana ];
62     # macro only supports linux as of now
63     # src/zsclient.cpp#L460
64     platforms = lib.platforms.linux;
65   };