about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/version-management/git-series/default.nix
blob: 2e173dd41be9314711f5e28df2d296261da6fd9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, stdenv
, curl
, libgit2
, libssh2
, openssl
, zlib
}:

rustPlatform.buildRustPackage {
  pname = "git-series";
  version = "unstable-2019-10-15";

  src = fetchFromGitHub {
    owner = "git-series";
    repo = "git-series";
    rev = "c570a015e15214be46a7fd06ba08526622738e20";
    sha256 = "1i0m2b7ma6xvkg95k57gaj1wpc1rfvka6h8jr5hglxmqqbz6cb6w";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
  };

  nativeBuildInputs = [
    pkg-config
  ] ++ lib.optionals stdenv.isDarwin [
    curl
  ];

  buildInputs = [
    libgit2
    libssh2
    openssl
    zlib
  ] ++ lib.optionals stdenv.isDarwin [
    curl
  ];

  LIBGIT2_SYS_USE_PKG_CONFIG = true;
  LIBSSH2_SYS_USE_PKG_CONFIG = true;

  # update Cargo.lock to work with openssl 3
  postPatch = ''
    ln -sf ${./Cargo.lock} Cargo.lock
  '';

  postInstall = ''
    install -D "$src/git-series.1" "$out/man/man1/git-series.1"
  '';

  meta = with lib; {
    description = "A tool to help with formatting git patches for review on mailing lists";
    longDescription = ''
      git series tracks changes to a patch series over time. git
      series also tracks a cover letter for the patch series,
      formats the series for email, and prepares pull requests.
    '';
    homepage = "https://github.com/git-series/git-series";

    license = licenses.mit;
    maintainers = with maintainers; [ edef vmandela ];
  };
}